public inbox for cygwin-apps-cvs@sourceware.org
help / color / mirror / Atom feed
From: Jon TURNEY <jturney@sourceware.org>
To: cygwin-apps-cvs@sourceware.org
Subject: [setup - the official Cygwin setup program] branch master, updated. release_2.915
Date: Mon, 10 Jan 2022 15:13:47 +0000 (GMT)	[thread overview]
Message-ID: <20220110151347.358043858C60@sourceware.org> (raw)




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
     {



                 reply	other threads:[~2022-01-10 15:13 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220110151347.358043858C60@sourceware.org \
    --to=jturney@sourceware.org \
    --cc=cygwin-apps-cvs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).