summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>1994-07-03 13:18:31 +0000
committerJim Meyering <jim@meyering.net>1994-07-03 13:18:31 +0000
commit363b712c93b718987517dcaac58a850ade801165 (patch)
tree05e54cce6f00d55608a483ce4f76db54e11302b7 /lib
parent763968d42841f10e5e98ed022ffba320cbaa3650 (diff)
downloadcoreutils-363b712c93b718987517dcaac58a850ade801165.tar.xz
.
Diffstat (limited to 'lib')
-rw-r--r--lib/makepath.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/makepath.c b/lib/makepath.c
index bb6a09c12..4d647b5ef 100644
--- a/lib/makepath.c
+++ b/lib/makepath.c
@@ -206,7 +206,10 @@ make_path (argpath, mode, parent_mode, owner, group, verbose_fmt_string)
/* We're done making leading directories.
Make the final component of the path. */
- if (mkdir (dirpath, mode))
+ /* The path could end in "/." or contain "/..", so test
+ if we really have to create the directory. */
+
+ if (stat (dirpath, &stats) && mkdir (dirpath, mode))
{
error (0, errno, "cannot make directory `%s'", dirpath);
umask (oldmask);