diff options
author | Daniel Friesel <derf@derf.homelinux.org> | 2009-01-26 13:35:35 +0100 |
---|---|---|
committer | Daniel Friesel <derf@derf.homelinux.org> | 2009-01-26 13:35:35 +0100 |
commit | b85289379833df99e754b61b1b449c04ad567d89 (patch) | |
tree | 71579aebe96276c5e591aeba3c5c207a1bb6ff38 /bin/checklinks | |
parent | 65944ac0e1dc9460fd248f04194a34214506afa2 (diff) |
checklinks: Fixed mkdirs
Diffstat (limited to 'bin/checklinks')
-rwxr-xr-x | bin/checklinks | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/bin/checklinks b/bin/checklinks index a2e21af..5016aba 100755 --- a/bin/checklinks +++ b/bin/checklinks @@ -105,8 +105,11 @@ sub check_hardlink { sub mkdirs { my $source = shift; my $path = $base; - $source =~ s/\/[^\/]+$//; - foreach(split(/\//, $source)) { + my @dirs = split(/\//, $source); + + # the last element is the file + pop(@dirs); + foreach(@dirs) { unless(-d "$path/$_") { mkdir("$path/$_") or die("Can't create $path/$_: $!"); } |