mirror of
https://git.proxmox.com/git/libgit2
synced 2025-07-03 14:38:49 +00:00
filebuf: fix resolving absolute symlinks
The symlink destination is always concatenated to the original path. Fix this by using `git_buf_sets` instead of `git_buf_puts`.
This commit is contained in:
parent
7143145f2f
commit
86a8cd9f6a
@ -246,7 +246,7 @@ static int resolve_symlink(git_buf *out, const char *path)
|
|||||||
|
|
||||||
root = git_path_root(target.ptr);
|
root = git_path_root(target.ptr);
|
||||||
if (root >= 0) {
|
if (root >= 0) {
|
||||||
if ((error = git_buf_puts(&curpath, target.ptr)) < 0)
|
if ((error = git_buf_sets(&curpath, target.ptr)) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
} else {
|
} else {
|
||||||
git_buf dir = GIT_BUF_INIT;
|
git_buf dir = GIT_BUF_INIT;
|
||||||
|
Loading…
Reference in New Issue
Block a user