[setup - the official Cygwin setup program] branch master, updated. release_2.915
Jon TURNEY via Cygwin-apps-cvs <[email protected]>
| Newsgroups | gmane.os.cygwin.cvs.apps |
|---|---|
| Message-ID | <[email protected]> |
https://sourceware.org/git/gitweb.cgi?p=cygwin-apps/setup.git;h=2fd81bdf6ad6fc0c116c4a9b4c888f6b9110c08e commit 2fd81bdf6ad6fc0c116c4a9b4c888f6b9110c08e Author: Jon Turney <[email protected]> Date: Sun Jan 9 21:17:14 2022 +0000 Improve symlinks to absolute paths made for ' --symlink-type native' Match Cygwin DLL behaviour of not using '\\?\' prefix if the target path is short enough not to need it. This improves how the symlink is reported by CMD buildin 'DIR', and handled by File Explorer's file properties dialog. Diff: --- mklink2.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/mklink2.cc b/mklink2.cc index 190b74d5..cf4df8b1 100644 --- a/mklink2.cc +++ b/mklink2.cc @@ -282,6 +282,11 @@ mknativesymlink (const char *from, const char *to) // convert back from nt namespace to win32 file namespace to use with // CreateSymbolicLinkW() wabsto[1] = '\\'; + // Some parts of Windows don't correctly handle a win32 file namespace + // prefix in the symlink target. So, for maximum interoperability, we use + // a short path instead, if the target path will be less than MAX_PATH. + if (wcslen(wabsto) < (MAX_PATH + 4)) + wto = wabsto + 4; } else {