]> git.ipfire.org Git - thirdparty/git.git/blobdiff - git-cvsserver.perl
perl: bump the required Perl version to 5.8 from 5.6.[21]
[thirdparty/git.git] / git-cvsserver.perl
index 3833beeef38c35bf5da0407e89a959874a253307..2822bed1fdf6977cd415461bc48630a4996f7084 100755 (executable)
@@ -15,6 +15,7 @@
 ####
 ####
 
+use 5.008;
 use strict;
 use warnings;
 use bytes;
@@ -2415,15 +2416,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");
@@ -2656,9 +2662,12 @@ sub descramble
     );
     my ($str) = @_;
 
-    # This should never happen, the same password format (A) bas been
+    # 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;