diff options
author | nbm <nbm@FreeBSD.org> | 2000-06-28 14:54:07 +0000 |
---|---|---|
committer | nbm <nbm@FreeBSD.org> | 2000-06-28 14:54:07 +0000 |
commit | ce68da90ca9d1cc533704542a9be355c2fffa434 (patch) | |
tree | 3e6c1a9171daa8eb39c6ef2bffb21627dbee90dd | |
parent | c328bb90a7d8a1f4d56302759d68d581ffef5666 (diff) | |
download | FreeBSD-src-ce68da90ca9d1cc533704542a9be355c2fffa434.zip FreeBSD-src-ce68da90ca9d1cc533704542a9be355c2fffa434.tar.gz |
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)
-rw-r--r-- | bin/rmdir/rmdir.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/bin/rmdir/rmdir.c b/bin/rmdir/rmdir.c index 4be8427..5c16c3d 100644 --- a/bin/rmdir/rmdir.c +++ b/bin/rmdir/rmdir.c @@ -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 == '/') |