fs-util: small tweak in chase_symlinks()
If we follow an absolute symlink there's no need to prefix the path with a "/", since by definition it already has one. This helps suppressing double "/" in resolved paths containing absolute symlinks.
This commit is contained in:
parent
f7c9f4a2a9
commit
8c4a8ea2ac
|
@ -766,12 +766,11 @@ int chase_symlinks(const char *path, const char *original_root, unsigned flags,
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
/* Prefix what's left to do with what we just read, and start the loop again, but
|
||||||
|
* remain in the current directory. */
|
||||||
/* Prefix what's left to do with what we just read, and start the loop again,
|
joined = strjoin(destination, todo);
|
||||||
* but remain in the current directory. */
|
} else
|
||||||
|
joined = strjoin("/", destination, todo);
|
||||||
joined = strjoin("/", destination, todo);
|
|
||||||
if (!joined)
|
if (!joined)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue