From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2201) id 358043858C60; Mon, 10 Jan 2022 15:13:47 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 358043858C60 To: cygwin-apps-cvs@sourceware.org Subject: [setup - the official Cygwin setup program] branch master, updated. release_2.915 X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Oldrev: 85789118355984ebb98d709aedd6a219bedec250 X-Git-Newrev: 2fd81bdf6ad6fc0c116c4a9b4c888f6b9110c08e Message-Id: <20220110151347.358043858C60@sourceware.org> Date: Mon, 10 Jan 2022 15:13:47 +0000 (GMT) From: Jon TURNEY X-BeenThere: cygwin-apps-cvs@cygwin.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Cygwin-apps git logs List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Jan 2022 15:13:47 -0000 https://sourceware.org/git/gitweb.cgi?p=cygwin-apps/setup.git;h=2fd81bdf6ad6fc0c116c4a9b4c888f6b9110c08e commit 2fd81bdf6ad6fc0c116c4a9b4c888f6b9110c08e Author: Jon Turney 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 {