Download raw body.
Fix rmdir -p /foo/bar
> @@ -92,9 +92,11 @@ rm_path(char *path)
>
> while ((p = strrchr(path, '/')) != NULL) {
> /* Delete trailing slashes. */
> - while (--p > path && *p == '/')
> + while (--p >= path && *p == '/')
> continue;
I don't think this approach is kosher. p can now end up pointing before
path, which is UB. I think NetBSD's solution is cleaner, if slightly
less efficient:
https://github.com/NetBSD/src/blob/trunk/bin/rmdir/rmdir.c#L100
> *++p = '\0';
> + if (p == path)
> + break;
>
> if (rmdir(path) == -1) {
> warn("%s", path);
>
> --
> Christian "naddy" Weisgerber naddy@mips.inka.de
>
Fix rmdir -p /foo/bar