Fix the rmdir -p a/b/c/ case, where rmdir -p a/b/c works, and rmdir c/

works.

PR:		PR 6521
Submitted by:	Rudolf Cejka <xcejka00@dcse.fee.vutbr.cz>
Reviewed by:	eivind (in brief retrograde)
This commit is contained in:
Neil Blakey-Milner 2000-06-28 14:54:07 +00:00
parent ae8ac23395
commit e7919a4303
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=62213

View File

@ -96,6 +96,10 @@ rm_path(path)
{
char *p;
p = path + strlen(path);
while (--p > path && *p == '/')
;
*++p = '\0';
while ((p = strrchr(path, '/')) != NULL) {
/* Delete trailing slashes. */
while (--p > path && *p == '/')