From 84c6de080c36ad607cb2b4759ae36ce04b10831c Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Sun, 3 Jul 1994 13:18:31 +0000 Subject: [PATCH] . --- lib/makepath.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/makepath.c b/lib/makepath.c index bb6a09c12c..4d647b5ef3 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); -- 2.30.2