summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@edwardthomson.com>2020-03-08 18:14:09 +0000
committerEdward Thomson <ethomson@edwardthomson.com>2020-03-10 20:10:20 +0000
commit43d7a42bdde3ed137997856c892bbc11abb79bda (patch)
treed7192032d3dde7cacb88c772883abb23f1b5f511
parentf2b114ba828b561c63164dcfcc2707f11e31c8d8 (diff)
downloadlibgit2-43d7a42bdde3ed137997856c892bbc11abb79bda.tar.gz
win32: don't canonicalize symlink targets
Don't canonicalize symlink targets; our win32 path canonicalization routines expect an absolute path. In particular, using the path canonicalization routines for symlink targets (introduced in commit 7d55bee6d, "win32: fix relative symlinks pointing into dirs", 2020-01-10). Now, use the utf8 -> utf16 relative path handling functions, so that paths like "../foo" will be translated to "..\foo".
-rw-r--r--src/win32/posix_w32.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/win32/posix_w32.c b/src/win32/posix_w32.c
index 29641bdaf..cacf986e8 100644
--- a/src/win32/posix_w32.c
+++ b/src/win32/posix_w32.c
@@ -447,8 +447,7 @@ int p_symlink(const char *target, const char *path)
* relative symlinks, this is not someting we want.
*/
if (git_win32_path_from_utf8(path_w, path) < 0 ||
- git__utf8_to_16(target_w, MAX_PATH, target) < 0 ||
- git_win32_path_canonicalize(target_w) < 0)
+ git_win32_path_relative_from_utf8(target_w, target) < 0)
return -1;
dwFlags = SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE;