public inbox for cygwin-apps-cvs@sourceware.org
help / color / mirror / Atom feed
* [setup - the official Cygwin setup program] branch master, updated. release_2.915
@ 2022-01-10 15:13 Jon TURNEY
  0 siblings, 0 replies; only message in thread
From: Jon TURNEY @ 2022-01-10 15:13 UTC (permalink / raw)
  To: cygwin-apps-cvs




https://sourceware.org/git/gitweb.cgi?p=cygwin-apps/setup.git;h=2fd81bdf6ad6fc0c116c4a9b4c888f6b9110c08e

commit 2fd81bdf6ad6fc0c116c4a9b4c888f6b9110c08e
Author: Jon Turney <jon.turney@dronecode.org.uk>
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
     {



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-01-10 15:13 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-10 15:13 [setup - the official Cygwin setup program] branch master, updated. release_2.915 Jon TURNEY

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).