Re: [PATCH 1/2] git-svn, perl/Git.pm: add central method for prompting passwords honoring GIT_ASKPASS and SSH_ASKPASS
- From
- Sven Strickroth <sven.strickroth@tu-clausthal.de>
- Date
- Jan 3, 2012, 13:18 UTC
- Message-ID
- <4F030029.40006@tu-clausthal.de>
- In-Reply-To
- <CACBZZX6iMobuU90skpbNPaGQFxYNOAjmZ6ceO4PGqfZSMkgePQ@mail.gmail.com>
Am 03.01.2012 13:03 schrieb Ævar Arnfjörð Bjarmason:
>> I'm using msys perl (shipped with msysgit) and there just using chomp() >> did not work.
But why not drop all \n and \r, since we only accept and wait for a single line?
chomp($str = <STDIN>) works as expected, but for some reason the line I got from the ASKPASS tool isn't. Btw. the askpass tool provides a string followed with \n (c++).
Show 18 quoted lines
> That's odd, what does this print: > > perl -MData::Dumper -MFile::Temp=tempfile -we 'my $str = > "moo\015\012"; my ($fh, $name) = tempfile(); print $fh $str; close > $fh; open my $in, "<", $name or die $!; my $in_str = <$in>; chomp(my > $cin_str = $in_str); print "in_str:<$in_str> cin_str:<$cin_str> > END\n"' > > And how about this: > > perl -MData::Dumper -MFile::Temp=tempfile -we 'my $str = > "moo\015\012"; my ($fh, $name) = tempfile(); print $fh $str; close > $fh; open my $in, "<:crlf", $name or die $!; my $in_str = <$in>; > chomp(my $cin_str = $in_str); print "in_str:<$in_str> > cin_str:<$cin_str> END\n"' > > It could be that there's some bug in either perl or mingw's build of > perl where it won't turn on the :crlf IO layer by default.
I get an error in both cases "Das System kann die angegebene Datei nicht finden".
-- Best regards, Sven Strickroth ClamAV, a GPL anti-virus toolkit http://www.clamav.net PGP key id F5A9D4C4 @ any key-server