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:
parent
d4af5f3250
commit
0fba60818b
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=137902
@ -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);
|
||||||
|
Loading…
Reference in New Issue
Block a user