Module Name:    src
Committed By:   snj
Date:           Sat Aug 19 05:23:16 UTC 2017

Modified Files:
        src/bin/rmdir [netbsd-7]: rmdir.c

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


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.26.22.1 src/bin/rmdir/rmdir.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/bin/rmdir/rmdir.c
diff -u src/bin/rmdir/rmdir.c:1.26 src/bin/rmdir/rmdir.c:1.26.22.1
--- src/bin/rmdir/rmdir.c:1.26	Mon Aug 29 14:49:38 2011
+++ src/bin/rmdir/rmdir.c	Sat Aug 19 05:23:16 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: rmdir.c,v 1.26 2011/08/29 14:49:38 joerg Exp $ */
+/* $NetBSD: rmdir.c,v 1.26.22.1 2017/08/19 05:23:16 snj Exp $ */
 
 /*-
  * Copyright (c) 1992, 1993, 1994
@@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1992, 19
 #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.22.1 2017/08/19 05:23:16 snj Exp $");
 #endif
 #endif /* not lint */
 
@@ -103,6 +103,10 @@ rm_path(char *path)
 			/* Ignore trailing '/' on deleted name */
 			continue;
 
+		if (*path == 0)
+			/* At top level (root) directory */
+			break;
+
 		if (rmdir(path) < 0) {
 			warn("%s", path);
 			return (1);

Reply via email to