From eabea024e839030fdfa406ddf4a88bd6fd9f89d1 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bodo=20M=C3=B6ller?= Date: Tue, 8 Jun 1999 10:17:55 +0000 Subject: [PATCH] Don't make assumptions on what the path looks like. --- util/mkdir-p.pl | 8 ++++---- 1 file 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"; } -- 2.25.1