Changeset 24940

Show
Ignore:
Timestamp:
11.01.2012 14:27:20 (8 years ago)
Author:
ak19
Message:

Dr Bainbridge discovered a logic error in the order of steps in unregex_filename. These steps should be in reverse order of filename_to_regex.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/perllib/util.pm

    r24932 r24940  
    855855 
    856856    # need to put doubled backslashes for regex back to single 
    857     $filename =~ s/\\\\/\\/g; # remove RE syntax for \     
    858857    $filename =~ s/\\\./\./g; # remove RE syntax for . 
    859858    $filename =~ s@\\\(@(@g; # remove RE syntax for ( => "\(" turns into "(" 
     
    861860    $filename =~ s@\\\[@[@g; # remove RE syntax for [ => "\[" turns into "[" 
    862861    $filename =~ s@\\\]@]@g; # remove RE syntax for ] => "\]" turns into "]" 
     862     
     863    # \\ goes to \ 
     864    # This is the last step in reverse mirroring the order of steps in filename_to_regex() 
     865    $filename =~ s/\\\\/\\/g; # remove RE syntax for \     
    863866    return $filename; 
    864867}