Files
MSYS2-packages/msys2-runtime/0046-Revert-Cygwin-Handle-virtual-drives-as-non-symlinks.patch

35 lines
1.2 KiB
Diff

From 64a769a67a94d8d6f1dc262a33e50fccbb404d23 Mon Sep 17 00:00:00 2001
From: Jeremy Drake <cygwin@jdrake.com>
Date: Sat, 29 May 2021 13:17:08 -0700
Subject: [PATCH 46/N] Revert "Cygwin: Handle virtual drives as non-symlinks"
This reverts commit c8949d04001e3dbc03651475b6cd1c5623400835.
---
winsup/cygwin/path.cc | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc
index 85605cf..68b0a8d 100644
--- a/winsup/cygwin/path.cc
+++ b/winsup/cygwin/path.cc
@@ -3665,9 +3665,14 @@ restart:
subst X: C:\foo\bar
- Treat it as a normal file. */
+ Treat it like a symlink. This is required to tell an
+ lstat caller that the "drive" is actually pointing
+ somewhere else, thus, it's a symlink in POSIX speak. */
if (upath.Length == 14) /* \??\X:\ */
- goto file_not_symlink;
+ {
+ fileattr &= ~FILE_ATTRIBUTE_DIRECTORY;
+ path_flags |= PATH_SYMLINK;
+ }
/* For final paths differing in inner path components return
length as negative value. This informs path_conv::check
to skip realpath handling on the last path component. */
--
2.32.0.windows.2