Changeset 23414 for main/trunk


Ignore:
Timestamp:
2010-12-08T11:08:31+13:00 (13 years ago)
Author:
davidb
Message:

Need to be more careful when downgrading a filename to ensure we still return a string that is at least still defined

File:
1 edited

Legend:

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

    r23388 r23414  
    11231123    # be opened by Perl => convert it to a short DOS-like filename
    11241124
    1125 ##  print STDERR "**** asked to downgrade: $filename_full_path\n";
    1126 
    1127     $filename_full_path = Win32::GetShortPathName($filename_full_path);
    1128 
    1129 ##  print STDERR "**** now: $filename_full_path\n";
    1130 
    1131     # Make sure initial drive letter is lower-case (to fit in with rest of Greenstone)
    1132     $filename_full_path =~ s/^(.)/\l$1/;
     1125    my $short_filename = Win32::GetShortPathName($filename_full_path);
     1126    if (defined $short_filename) {
     1127        $filename_full_path = $short_filename;
     1128
     1129        # Make sure initial drive letter is lower-case (to fit in
     1130        # with rest of Greenstone)
     1131        $filename_full_path =~ s/^(.)/\l$1/;
     1132    }
    11331133    }
    11341134
Note: See TracChangeset for help on using the changeset viewer.