summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKen Brown <kbrown@cornell.edu>2020-01-15 10:49:21 -0500
committerKen Brown <kbrown@cornell.edu>2020-01-17 07:37:29 -0500
commit85aff2830a68ce79a280e5ea31fcf01342d61986 (patch)
tree92a47a290b5ce30a8592293528b965b722b40612
parent7e6c96d6e1485b52b4243d0cd9699f2063645660 (diff)
downloadcygnal-85aff2830a68ce79a280e5ea31fcf01342d61986.tar.gz
cygnal-85aff2830a68ce79a280e5ea31fcf01342d61986.tar.bz2
cygnal-85aff2830a68ce79a280e5ea31fcf01342d61986.zip
Cygwin: normalize_win32_path: allow drive without trailing backslash
Commit 283cb372, "Cygwin: normalize_win32_path: improve error checking", required a prefix '\\?\' or '\??\' in the source path to be followed by 'UNC\' or 'X:\', where X is a drive letter. That was too restrictive, since it disallowed the paths '\\?\X: and '\??\X:'. This caused problems when a user tried to use the root of a drive as the Cygwin installation root, as reported here: https://cygwin.com/ml/cygwin/2020-01/msg00111.html Modify the requirement so that '\??\X:' and '\\?\X:' are now allowed as source paths, without a trailing backslash.
-rw-r--r--winsup/cygwin/path.cc2
-rw-r--r--winsup/cygwin/release/3.1.34
2 files changed, 5 insertions, 1 deletions
diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc
index c8e73c64c..a00270210 100644
--- a/winsup/cygwin/path.cc
+++ b/winsup/cygwin/path.cc
@@ -1411,7 +1411,7 @@ normalize_win32_path (const char *src, char *dst, char *&tail)
&& src[2] == '?' && isdirsep (src[3]))
{
src += 4;
- if (isdrive (src) && isdirsep (src[2]))
+ if (isdrive (src) && (isdirsep (src[2]) || !src[2]))
beg_src_slash = false;
else if (!strncmp (src, "UNC", 3) && isdirsep (src[3]))
/* native UNC path */
diff --git a/winsup/cygwin/release/3.1.3 b/winsup/cygwin/release/3.1.3
index 0fcdccabb..489741136 100644
--- a/winsup/cygwin/release/3.1.3
+++ b/winsup/cygwin/release/3.1.3
@@ -6,3 +6,7 @@ Bug Fixes
- Fix the problem which overrides the code page setting.
Addresses: https://www.cygwin.com/ml/cygwin/2019-12/msg00292.html
+
+- Fix a regression that prevents the root of a drive from being the
+ Cygwin installation root.
+ Addresses: https://cygwin.com/ml/cygwin/2020-01/msg00111.html