summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>1998-03-13 23:35:25 +0000
committerJim Meyering <jim@meyering.net>1998-03-13 23:35:25 +0000
commit4078ae8de819f0cbd0335e5f1d03be35ee87503e (patch)
tree2fbb57282c667f4709b39ddf9081f07ae7643c2a
parent3086193091fb7ad6b9f1c1332ac63207a29a0e7b (diff)
downloadcoreutils-4078ae8de819f0cbd0335e5f1d03be35ee87503e.tar.gz
(remove_parents): Be consistent with documentation of
--verbose option and with remove.c in saying `removing...' before the operation is attempted. (main): Likewise. Suggestions from Santiago Vila.
-rw-r--r--src/rmdir.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/rmdir.c b/src/rmdir.c
index 7853aa080..dfa737ef2 100644
--- a/src/rmdir.c
+++ b/src/rmdir.c
@@ -86,11 +86,12 @@ remove_parents (char *path)
while (slash > path && *slash == '/')
--slash;
slash[1] = 0;
- fail = rmdir (path);
- /* Give a diagnostic for each successful removal if --verbose. */
- if (verbose && !fail)
- error (0, errno, _("removed directory, %s"), path);
+ /* Give a diagnostic for each attempted removal if --verbose. */
+ if (verbose)
+ error (0, errno, _("removing directory, %s"), path);
+
+ fail = rmdir (path);
if (fail)
{
@@ -189,11 +190,12 @@ main (int argc, char **argv)
/* Stripping slashes is harmless for rmdir;
if the arg is not a directory, it will fail with ENOTDIR. */
strip_trailing_slashes (dir);
- fail = rmdir (dir);
- /* Give a diagnostic for each successful removal if --verbose. */
- if (verbose && !fail)
- error (0, errno, _("removed directory, %s"), dir);
+ /* Give a diagnostic for each attempted removal if --verbose. */
+ if (verbose)
+ error (0, errno, _("removing directory, %s"), dir);
+
+ fail = rmdir (dir);
if (fail)
{