diff options
-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 == '/') |