Fix creating relative native symlinks in top-level directories

* path.cc (symlink_native): Fix index when looking for colon in path.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
This commit is contained in:
Corinna Vinschen 2015-11-26 12:12:52 +01:00
parent 6de53a3516
commit 2f4fef955c
2 changed files with 5 additions and 1 deletions

View File

@ -1,3 +1,7 @@
2015-11-26 Corinna Vinschen <corinna@vinschen.de>
* path.cc (symlink_native): Fix index when looking for colon in path.
2015-11-21 Corinna Vinschen <corinna@vinschen.de>
* nlsfuncs.cc (setlocaleinfo): New macro calling __setlocaleinfo.

View File

@ -1668,7 +1668,7 @@ symlink_native (const char *oldpath, path_conv &win32_newpath)
prefix strings. We start counting behind the \\?\ for speed. */
int num = cnt_bs (win32_oldpath.get_nt_native_path ()->Buffer + 4, c_old);
if (num < 1 /* locale drive. */
|| (win32_oldpath.get_nt_native_path ()->Buffer[6] != L':'
|| (win32_oldpath.get_nt_native_path ()->Buffer[5] != L':'
&& num < 3)) /* UNC path. */
{
/* 3a. No valid common path prefix: Create absolute symlink. */