Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2010-08-31 17:48:04 +0400
committerCorinna Vinschen <corinna@vinschen.de>2010-08-31 17:48:04 +0400
commit274116ea120047e71abffc76dc41bcacab4f7a54 (patch)
tree0f350c129bcf2d1e46b28831ef25fcf348f021c4
parent8fd414ffc62eedf37e576231fd6100f0d7b9c5f0 (diff)
* path.cc (normalize_posix_path): Preserve //./ and //?/ prefixes.
(path_conv::check): Allow access to root directory of native NT disk devices.
-rw-r--r--winsup/cygwin/ChangeLog6
-rw-r--r--winsup/cygwin/path.cc15
2 files changed, 21 insertions, 0 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 82b5194ee..68465663c 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,5 +1,11 @@
2010-08-31 Corinna Vinschen <corinna@vinschen.de>
+ * path.cc (normalize_posix_path): Preserve //./ and //?/ prefixes.
+ (path_conv::check): Allow access to root directory of native NT disk
+ devices.
+
+2010-08-31 Corinna Vinschen <corinna@vinschen.de>
+
* include/cygwin/version.h: Bump DLL minor version number to 7.
2010-08-30 Christopher Faylor <me+cygwin@cgf.cx>
diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc
index f0cdbee1c..fe81acd8b 100644
--- a/winsup/cygwin/path.cc
+++ b/winsup/cygwin/path.cc
@@ -267,6 +267,14 @@ normalize_posix_path (const char *src, char *dst, char *&tail)
{
*tail++ = *src++;
++dst_start;
+ /* Is that a //?/ or //./ prefix into the native NT namespace?
+ If so, preserve it. */
+ if ((src[1] == '.' || src[1] == '?') && isslash (src[2]))
+ {
+ *tail++ = *src++;
+ *tail++ = *src++;
+ dst_start += 2;
+ }
}
while (*src)
@@ -818,6 +826,13 @@ path_conv::check (const char *src, unsigned opt,
full_path[2] = '\\';
full_path[3] = '\0';
}
+ /* Otherwise, if the user requires a directory and explicitely
+ specified a path into the native NT namespace, add the trailing
+ backslash. It's needed to access the root dir. */
+ else if (need_directory
+ && full_path[0] == '\\' && full_path[1] == '\\'
+ && (full_path[2] == '.' || full_path[2] == '?'))
+ strcat (full_path, "\\");
/* If the incoming path was given in DOS notation, always treat
it as caseinsensitive,noacl path. This must be set before