From 4078ae8de819f0cbd0335e5f1d03be35ee87503e Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Fri, 13 Mar 1998 23:35:25 +0000 Subject: [PATCH] (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. --- src/rmdir.c | 18 ++++++++++-------- 1 file 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) { -- 2.34.1