Code

Do not strip CR when grepping HTTP headers.
[git.git] / git-cvsserver.perl
index 6de7921796597471990aa5498677522d8f9f236f..e9f3037df351ceed0262a8995f19903464163af8 100755 (executable)
@@ -2415,15 +2415,20 @@ sub kopts_from_path
     if ( defined ( $cfg->{gitcvs}{usecrlfattr} ) and
          $cfg->{gitcvs}{usecrlfattr} =~ /\s*(1|true|yes)\s*$/i )
     {
-        my ($val) = check_attr( "crlf", $path );
-        if ( $val eq "set" )
+        my ($val) = check_attr( "text", $path );
+        if ( $val eq "unspecified" )
         {
-            return "";
+            $val = check_attr( "crlf", $path );
         }
-        elsif ( $val eq "unset" )
+        if ( $val eq "unset" )
         {
             return "-kb"
         }
+        elsif ( check_attr( "eol", $path ) ne "unspecified" ||
+                $val eq "set" || $val eq "input" )
+        {
+            return "";
+        }
         else
         {
             $log->info("Unrecognized check_attr crlf $path : $val");
@@ -2658,7 +2663,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;