summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSven Strickroth2 <email@cs-ware.de>2017-03-20 11:21:00 +0100
committerPatrick Steinhardt <ps@pks.im>2017-03-20 12:14:05 +0100
commit86a8cd9f6a039889801b5bec865a4bc3deb30f47 (patch)
tree9d08d504e7d5da9437ef7fc8887a77d74366cfef
parent7143145f2fcb0f7476f333f9df990b8a06cd52c0 (diff)
downloadlibgit2-86a8cd9f6a039889801b5bec865a4bc3deb30f47.tar.gz
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`.
-rw-r--r--src/filebuf.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/filebuf.c b/src/filebuf.c
index ef68b16f4..825b9c04c 100644
--- a/src/filebuf.c
+++ b/src/filebuf.c
@@ -246,7 +246,7 @@ static int resolve_symlink(git_buf *out, const char *path)
root = git_path_root(target.ptr);
if (root >= 0) {
- if ((error = git_buf_puts(&curpath, target.ptr)) < 0)
+ if ((error = git_buf_sets(&curpath, target.ptr)) < 0)
goto cleanup;
} else {
git_buf dir = GIT_BUF_INIT;