]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
(remove_parents): Be consistent with documentation of
authorJim Meyering <jim@meyering.net>
Fri, 13 Mar 1998 23:35:25 +0000 (23:35 +0000)
committerJim Meyering <jim@meyering.net>
Fri, 13 Mar 1998 23:35:25 +0000 (23:35 +0000)
--verbose option and with remove.c in saying `removing...' before
the operation is attempted.
(main): Likewise.
Suggestions from Santiago Vila.

src/rmdir.c

index 7853aa08010faf79be55c3a826493a8b30e756b5..dfa737ef2dd04922adc3cd97e6afaa8e1e33b1d6 100644 (file)
@@ -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)
        {