From b85289379833df99e754b61b1b449c04ad567d89 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Mon, 26 Jan 2009 13:35:35 +0100 Subject: checklinks: Fixed mkdirs --- bin/checklinks | 7 +++++-- 1 file 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/$_: $!"); } -- cgit v1.2.3