summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTony Cook <tony@develop-help.com>2018-03-01 15:26:22 +1100
committerTony Cook <tony@develop-help.com>2018-03-06 14:53:32 +1100
commitb857191d01c23df63dc1112e443b194a13305179 (patch)
treeb592b873e01829a92760c650ce8414424c48e207 /lib
parentc0221e16334efbe9723722578949dc3916d669d4 (diff)
downloadperl-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/mktables6
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;