summaryrefslogtreecommitdiffstats
path: root/util/mkdir-p.pl
diff options
context:
space:
mode:
authorBodo Möller <bodo@openssl.org>1999-06-08 12:17:55 +0200
committerBodo Möller <bodo@openssl.org>1999-06-08 12:17:55 +0200
commiteabea024e839030fdfa406ddf4a88bd6fd9f89d1 (patch)
treece97c530b5dfb7063d9c84fc40314d4f73877791 /util/mkdir-p.pl
parentComplete support for PKCS#5 v2.0. Still needs extensive testing. (diff)
downloadopenssl-eabea024e839030fdfa406ddf4a88bd6fd9f89d1.tar.xz
openssl-eabea024e839030fdfa406ddf4a88bd6fd9f89d1.zip
Don't make assumptions on what the path looks like.
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";
}