summaryrefslogtreecommitdiffstats
path: root/util/mkdir-p.pl
diff options
context:
space:
mode:
Diffstat (limited to 'util/mkdir-p.pl')
-rwxr-xr-xutil/mkdir-p.pl8
1 files changed, 4 insertions, 4 deletions
diff --git a/util/mkdir-p.pl b/util/mkdir-p.pl
index 2c003d6e84..6c69c2daa4 100755
--- a/util/mkdir-p.pl
+++ b/util/mkdir-p.pl
@@ -15,19 +15,19 @@ foreach $arg (@ARGV) {
sub do_mkdir_p {
local($dir) = @_;
- $dir =~ s|/*$||;
+ $dir =~ s|/*\Z(?!\n)||s;
if (-d $dir) {
return;
}
- if ($dir =~ /\//) {
+ if ($dir =~ m|[^/]/|s) {
local($parent) = $dir;
- $parent =~ s|[^/]*$||;
+ $parent =~ s|[^/]*\Z(?!\n)||s;
do_mkdir_p($parent);
}
mkdir($dir, 0777) || die "Cannot create directory $dir: $!\n";
- print "created directory $dir\n";
+ print "created directory `$dir'\n";
}