changeset 237:cb57480dbf0a

.
author Jim Meyering <jim@meyering.net>
date Sun, 03 Jul 1994 13:18:31 +0000
parents 05959ea73146
children 761dc74b75b4
files lib/makepath.c
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/lib/makepath.c
+++ b/lib/makepath.c
@@ -206,7 +206,10 @@
       /* 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);