diff options
author | Jim Meyering <jim@meyering.net> | 1997-10-06 13:03:29 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 1997-10-06 13:03:29 +0000 |
commit | 7a4cc2dff1bd63de722ec9735275c45858d1137a (patch) | |
tree | 6bfb63654dc0e72e854ebbfc7de052070d91a26d /lib | |
parent | b6bc4c265e2d2aacaa3461e2bd2fa177b7a2e6d5 (diff) | |
download | coreutils-7a4cc2dff1bd63de722ec9735275c45858d1137a.tar.xz |
(make_path): Print message IFF the directory was
just created and the format string is non-NULL.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/makepath.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/makepath.c b/lib/makepath.c index 4218e90c6..8ac46fe46 100644 --- a/lib/makepath.c +++ b/lib/makepath.c @@ -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 |