]> git.ipfire.org Git - thirdparty/git.git/commitdiff
git-cvsserver: fix error for invalid password formats
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>
Sat, 19 Jun 2010 16:06:58 +0000 (16:06 +0000)
committerJunio C Hamano <gitster@pobox.com>
Mon, 21 Jun 2010 04:58:26 +0000 (21:58 -0700)
Change the error message to report the erroneous password
character. $1 was never set in the previos version, it was a leftover
from older code that used a regex for the test.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
git-cvsserver.perl

index 6de7921796597471990aa5498677522d8f9f236f..0f45c395098f2e19b7ce93ac17c45d128f05ff0d 100755 (executable)
@@ -2658,7 +2658,10 @@ sub descramble
 
     # This should never happen, the same password format (A) has been
     # used by CVS since the beginning of time
-    die "invalid password format $1" unless substr($str, 0, 1) eq 'A';
+    {
+        my $fmt = substr($str, 0, 1);
+        die "invalid password format `$fmt'" unless $fmt eq 'A';
+    }
 
     my @str = unpack "C*", substr($str, 1);
     my $ret = join '', map { chr $SHIFTS[$_] } @str;