Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 86a8cd9

Browse files
cswarepks-t
authored andcommitted
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`.
1 parent 7143145 commit 86a8cd9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/filebuf.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ static int resolve_symlink(git_buf *out, const char *path)
246246

247247
root = git_path_root(target.ptr);
248248
if (root >= 0) {
249-
if ((error = git_buf_puts(&curpath, target.ptr)) < 0)
249+
if ((error = git_buf_sets(&curpath, target.ptr)) < 0)
250250
goto cleanup;
251251
} else {
252252
git_buf dir = GIT_BUF_INIT;

0 commit comments

Comments
 (0)