Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-8]: src/bin/rmdir Pull up following revision(s) (requested by gin...



details:   https://anonhg.NetBSD.org/src/rev/20144b24fe8a
branches:  netbsd-8
changeset: 850938:20144b24fe8a
user:      snj <snj%NetBSD.org@localhost>
date:      Mon Aug 14 23:54:30 2017 +0000

description:
Pull up following revision(s) (requested by ginsbach in ticket #208):
        bin/rmdir/rmdir.c: revision 1.27
PR/48182: Fix rmdir -p handling of top-level (root) directory.

diffstat:

 bin/rmdir/rmdir.c |  8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diffs (29 lines):

diff -r 00e83081f367 -r 20144b24fe8a bin/rmdir/rmdir.c
--- a/bin/rmdir/rmdir.c Mon Aug 14 23:53:20 2017 +0000
+++ b/bin/rmdir/rmdir.c Mon Aug 14 23:54:30 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: rmdir.c,v 1.26 2011/08/29 14:49:38 joerg Exp $ */
+/* $NetBSD: rmdir.c,v 1.26.36.1 2017/08/14 23:54:30 snj Exp $ */
 
 /*-
  * Copyright (c) 1992, 1993, 1994
@@ -39,7 +39,7 @@
 #if 0
 static char sccsid[] = "@(#)rmdir.c    8.3 (Berkeley) 4/2/94";
 #else
-__RCSID("$NetBSD: rmdir.c,v 1.26 2011/08/29 14:49:38 joerg Exp $");
+__RCSID("$NetBSD: rmdir.c,v 1.26.36.1 2017/08/14 23:54:30 snj Exp $");
 #endif
 #endif /* not lint */
 
@@ -103,6 +103,10 @@
                        /* Ignore trailing '/' on deleted name */
                        continue;
 
+               if (*path == 0)
+                       /* At top level (root) directory */
+                       break;
+
                if (rmdir(path) < 0) {
                        warn("%s", path);
                        return (1);



Home | Main Index | Thread Index | Old Index