Commit 86a8cd9f6a039889801b5bec865a4bc3deb30f47

Sven Strickroth2 2017-03-20T11:21: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`.

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/src/filebuf.c b/src/filebuf.c
index ef68b16..825b9c0 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;