summaryrefslogtreecommitdiff
path: root/bin/checklinks
diff options
context:
space:
mode:
authorDaniel Friesel <derf@derf.homelinux.org>2009-01-26 13:35:35 +0100
committerDaniel Friesel <derf@derf.homelinux.org>2009-01-26 13:35:35 +0100
commitb85289379833df99e754b61b1b449c04ad567d89 (patch)
tree71579aebe96276c5e591aeba3c5c207a1bb6ff38 /bin/checklinks
parent65944ac0e1dc9460fd248f04194a34214506afa2 (diff)
checklinks: Fixed mkdirs
Diffstat (limited to 'bin/checklinks')
-rwxr-xr-xbin/checklinks7
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/$_: $!");
}