(make_path): Print message IFF the directory was
authorJim Meyering <jim@meyering.net>
Mon, 6 Oct 1997 13:03:29 +0000 (13:03 +0000)
committerJim Meyering <jim@meyering.net>
Mon, 6 Oct 1997 13:03:29 +0000 (13:03 +0000)
just created and the format string is non-NULL.

lib/makepath.c

index 4218e90c6035f0350e6984ab3911b8b1a71d2805..8ac46fe466b14911f0199712ad7facc1a7f75517 100644 (file)
@@ -206,6 +206,8 @@ make_path (argpath, mode, parent_mode, owner, group, preserve_existing,
 
       while (1)
        {
+         int newly_created_dir = 1;
+
          /* slash points to the leftmost unprocessed component of dirpath.  */
          basename_dir = slash;
 
@@ -236,10 +238,11 @@ make_path (argpath, mode, parent_mode, owner, group, preserve_existing,
              else
                {
                  /* DIRPATH already exists and is a directory. */
+                 newly_created_dir = 0;
                }
            }
 
-         if (verbose_fmt_string != NULL)
+         if (newly_created_dir && verbose_fmt_string != NULL)
            error (0, 0, verbose_fmt_string, dirpath);
 
          if (owner != (uid_t) -1 && group != (gid_t) -1