Bug 392722 - nsinstall doesn't work if paths have double slashes, patch by Fabien Tassin <fta+bugzilla@sofaraway.org>, r=me
git-svn-id: svn://10.0.0.236/trunk@233338 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
bed23e2810
commit
cdba22e671
@ -111,8 +111,7 @@ mkdirs(char *path, mode_t mode)
|
|||||||
|
|
||||||
while (*path == '/' && path[1] == '/')
|
while (*path == '/' && path[1] == '/')
|
||||||
path++;
|
path++;
|
||||||
while ((cp = strrchr(path, '/')) && cp[1] == '\0')
|
for (cp = strrchr(path, '/'); cp && cp != path && *(cp - 1) == '/'; cp--);
|
||||||
*cp = '\0';
|
|
||||||
if (cp && cp != path) {
|
if (cp && cp != path) {
|
||||||
*cp = '\0';
|
*cp = '\0';
|
||||||
if ((lstat(path, &sb) < 0 || !S_ISDIR(sb.st_mode)) &&
|
if ((lstat(path, &sb) < 0 || !S_ISDIR(sb.st_mode)) &&
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user