Ticket #2572: patchfs-filename-whitespace.patch

File patchfs-filename-whitespace.patch, 1.8 KB (added by storchaka, 13 years ago)
  • src/vfs/extfs/helpers/patchfs.in

    diff --git a/src/vfs/extfs/helpers/patchfs.in b/src/vfs/extfs/helpers/patchfs.in
    index 19667ab..908c9f3 100644
    a b my $fileutil = 'file -b'; 
    2323my $parsedates = eval 'require Date::Parse'; 
    2424 
    2525# regular expressions 
    26 my $unified_header=qr/^--- .*\n\+\+\+ .*\n$/; 
    27 my $unified_extract=qr/^--- ([^\s]+).*\n\+\+\+ ([^\s]+)\s*([^\t\n]*)/; 
     26my $unified_header=qr/^--- .*\t.*\n\+\+\+ .*\t.*\n$/; 
     27my $unified_extract=qr/^--- ([^\t]+).*\n\+\+\+ ([^\t]+)\s*(.*)\n/; 
     28my $unified_header2=qr/^--- .*\n\+\+\+ .*\n$/; 
     29my $unified_extract2=qr/^--- ([^\s]+).*\n\+\+\+ ([^\s]+)\s*(.*)\n/; 
    2830my $unified_contents=qr/^([+\-\\ \n]|@@ .* @@)/; 
    2931my $unified_hunk=qr/@@ -(\d+)(,(\d+))? \+(\d+)(,(\d+))? @@.*\n/; 
    3032 
    31 my $context_header=qr/^\*\*\* .*\n--- .*\n$/; 
    32 my $context_extract=qr/^\*\*\* ([^\s]+).*\n--- ([^\s]+)\s*([^\t\n]*)/; 
     33my $context_header=qr/^\*\*\* .*\t.*\n--- .*\t.*\n$/; 
     34my $context_extract=qr/^\*\*\* ([^\t]+).*\n--- ([^\t]+)\s*(.*)\n/; 
     35my $context_header2=qr/^\*\*\* .*\n--- .*\n$/; 
     36my $context_extract2=qr/^\*\*\* ([^\s]+).*\n--- ([^\s]+)\s*(.*)\n/; 
    3337my $context_contents=qr/^([!+\-\\ \n]|-{3} .* -{4}|\*{3} .* \*{4}|\*{15})/; 
    3438 
    3539my $ls_extract_id=qr/^[^\s]+\s+[^\s]+\s+([^\s]+)\s+([^\s]+)/; 
    sub parse($$$$) 
    201205            if($unified) { 
    202206                if(/$unified_header/o) { 
    203207                    ($fsrc,$fdst,$time) = /$unified_extract/o; 
     208                } elsif(/$unified_header2/o) { 
     209                    ($fsrc,$fdst,$time) = /$unified_extract2/o; 
    204210                } else { 
    205211                    error "Can't parse unified diff header"; 
    206212                } 
    207213            } elsif($context) { 
    208214                if(/$context_header/o) { 
    209215                    ($fsrc,$fdst,$time) = /$context_extract/o; 
     216                } elsif(/$context_header2/o) { 
     217                    ($fsrc,$fdst,$time) = /$context_extract2/o; 
    210218                } else { 
    211219                    error "Can't parse context diff header"; 
    212220                }