Do not emit a spurious warning when "directory" argument

to "rmdir -p" is absolute, with one or more leading slash.
This commit is contained in:
ru 2004-11-20 00:41:08 +00:00
parent f5e118fbbd
commit 339fc9c24a

View File

@ -103,9 +103,11 @@ rm_path(char *path)
*++p = '\0'; *++p = '\0';
while ((p = strrchr(path, '/')) != NULL) { while ((p = strrchr(path, '/')) != NULL) {
/* Delete trailing slashes. */ /* Delete trailing slashes. */
while (--p > path && *p == '/') while (--p >= path && *p == '/')
; ;
*++p = '\0'; *++p = '\0';
if (p == path)
break;
if (rmdir(path) < 0) { if (rmdir(path) < 0) {
warn("%s", path); warn("%s", path);