lib/package_alternatives.c: Handle // cases.
This commit is contained in:
@@ -66,9 +66,10 @@ normpath(char *path) {
|
|||||||
if (strncmp(p, "/../", 4) == 0 || strncmp(p, "/..", 4) == 0) {
|
if (strncmp(p, "/../", 4) == 0 || strncmp(p, "/..", 4) == 0) {
|
||||||
memmove(seg ? seg : p, p+3, strlen(p+3) + 1);
|
memmove(seg ? seg : p, p+3, strlen(p+3) + 1);
|
||||||
return normpath(path);
|
return normpath(path);
|
||||||
}
|
} else if (strncmp(p, "/./", 3) == 0 || strncmp(p, "/.", 3) == 0) {
|
||||||
else if (strncmp(p, "/./", 3) == 0 || strncmp(p, "/.", 3) == 0) {
|
|
||||||
memmove(p, p+2, strlen(p+2) + 1);
|
memmove(p, p+2, strlen(p+2) + 1);
|
||||||
|
} else if (strncmp(p, "//", 2) == 0 || strncmp(p, "/", 2) == 0) {
|
||||||
|
memmove(p, p+1, strlen(p+1) + 1);
|
||||||
}
|
}
|
||||||
if (*p == '/')
|
if (*p == '/')
|
||||||
seg = p;
|
seg = p;
|
||||||
|
Reference in New Issue
Block a user