(make_path): Restore umask *before* creating the final component.
authorJim Meyering <jim@meyering.net>
Thu, 21 Nov 2002 09:44:27 +0000 (09:44 +0000)
committerJim Meyering <jim@meyering.net>
Thu, 21 Nov 2002 09:44:27 +0000 (09:44 +0000)
lib/makepath.c

index fbe3f6a65e1f25ac24197e471306afe9bc70d855..26cb98634c6122993272c8636b049ff9d0ce3f75 100644 (file)
@@ -347,6 +347,9 @@ make_path (const char *argpath,
       if (!do_chdir)
        basename_dir = dirpath;
 
+      /* Done creating leading directories.  Restore original umask.  */
+      umask (oldmask);
+
       /* We're done making leading directories.
         Create the final component of the path.  */
 
@@ -356,9 +359,6 @@ make_path (const char *argpath,
          return 1;
        }
 
-      /* Done creating directories.  Restore original umask.  */
-      umask (oldmask);
-
       if (verbose_fmt_string != NULL)
        error (0, 0, verbose_fmt_string, quote (dirpath));