aboutsummaryrefslogtreecommitdiffstats
path: root/Packdrakeng.pm
diff options
context:
space:
mode:
Diffstat (limited to 'Packdrakeng.pm')
-rw-r--r--Packdrakeng.pm6
1 files changed, 4 insertions, 2 deletions
diff --git a/Packdrakeng.pm b/Packdrakeng.pm
index b45e04a..23bc9e2 100644
--- a/Packdrakeng.pm
+++ b/Packdrakeng.pm
@@ -43,9 +43,11 @@ sub tempfile {
sub mkpath {
my ($path) = @_;
$path =~ s:/*$::; # removing leading '/'
- my $parent = substr($path, 0, rindex($path, '/'));
-d $path and return 1;
- -d $parent || mkpath($parent) or return 0;
+ # need parent creation ?
+ if (index($path, '/') > 0) {
+ mkpath(substr($path, 0, rindex($path, '/'))) or return 0;
+ }
mkdir($path)
}