Changeset 22921


Ignore:
Timestamp:
2010-09-17T16:21:10+12:00 (14 years ago)
Author:
sjm84
Message:

Anu changed this to escape backslashes in file names before using them in a regular expression

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/perllib/plugouts/DSpacePlugout.pm

    r20903 r22921  
    182182    $real_filename =~ s/^\\(.*)/$1/i;
    183183    if (-e $real_filename) {
    184 
    185         if ($real_filename =~ m/$source_filename$/) {
     184        # escape backslashes in path for upcoming regex match
     185        my $escaped_source_filename = $source_filename;
     186        $escaped_source_filename =~ s/\\/\\\\/g;       
     187        if ($real_filename =~ m/$escaped_source_filename$/) {
    186188        next;
    187189        }
Note: See TracChangeset for help on using the changeset viewer.