From: Jim Meyering Date: Sun, 3 Jul 1994 13:18:31 +0000 (+0000) Subject: . X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=84c6de080c36ad607cb2b4759ae36ce04b10831c;p=pspp . --- 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);