]> sourceware.org Git - newlib-cygwin.git/commitdiff
* path.cc (normalize_posix_path): Preserve //./ and //?/ prefixes.
authorCorinna Vinschen <corinna@vinschen.de>
Tue, 31 Aug 2010 13:48:04 +0000 (13:48 +0000)
committerCorinna Vinschen <corinna@vinschen.de>
Tue, 31 Aug 2010 13:48:04 +0000 (13:48 +0000)
(path_conv::check): Allow access to root directory of native NT disk
devices.

winsup/cygwin/ChangeLog
winsup/cygwin/path.cc

index 82b5194ee6dae282bf6fe51a836f5f611ec52083..68465663c5fae78d1e03abdd5957e7b44c26d5f4 100644 (file)
@@ -1,3 +1,9 @@
+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.
index f0cdbee1c453eb987119f0dc68d8f4ccaa389795..fe81acd8bbaa07cfc36c39e9da6b51fdd9f24ffc 100644 (file)
@@ -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
This page took 0.039095 seconds and 5 git commands to generate.