diff options
author | Tony Cook <tony@develop-help.com> | 2018-03-01 15:26:22 +1100 |
---|---|---|
committer | Tony Cook <tony@develop-help.com> | 2018-03-06 14:53:32 +1100 |
commit | b857191d01c23df63dc1112e443b194a13305179 (patch) | |
tree | b592b873e01829a92760c650ce8414424c48e207 /lib | |
parent | c0221e16334efbe9723722578949dc3916d669d4 (diff) | |
download | perl-b857191d01c23df63dc1112e443b194a13305179.tar.gz |
(perl #132925) correct path handling in mktables
the lexical my $file inside the loop masked the for loop $file,
wasting the work done to canonicalize the path names.
The grep on length is required since splitdir() can return empty
strings.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/unicore/mktables | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/unicore/mktables b/lib/unicore/mktables index c6436723d5..88d9c036a3 100644 --- a/lib/unicore/mktables +++ b/lib/unicore/mktables @@ -20230,9 +20230,9 @@ if ( $file_list and $make_list ) { print "Updating '$file_list'\n" if $verbosity >= $PROGRESS; foreach my $file (@input_files, @files_actually_output) { - my (undef, $directories, $file) = File::Spec->splitpath($file); - my @directories = File::Spec->splitdir($directories); - $file = join '/', @directories, $file; + my (undef, $directories, $basefile) = File::Spec->splitpath($file); + my @directories = grep length, File::Spec->splitdir($directories); + $file = join '/', @directories, $basefile; } my $ofh; |