From 363b712c93b718987517dcaac58a850ade801165 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Sun, 3 Jul 1994 13:18:31 +0000 Subject: . --- lib/makepath.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'lib') 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); -- cgit v1.2.3-70-g09d2