]> sourceware.org Git - newlib-cygwin.git/commitdiff
Transform all special chars in relative Windows path string
authorCorinna Vinschen <corinna@vinschen.de>
Thu, 14 Jul 2016 18:52:04 +0000 (20:52 +0200)
committerCorinna Vinschen <corinna@vinschen.de>
Thu, 14 Jul 2016 18:52:04 +0000 (20:52 +0200)
get_nt_native_path handles the transposition of chars not allowed
in Windows pathnames.  However, it never starts transposition at
the start of the string, which is wrong for relative paths.  Fix it.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
winsup/cygwin/path.cc

index 7373fb72d3941c391f04151bf65f05e4d039da68..970a0fec4b80e72f2ac94dab659f9075d722c4cb 100644 (file)
@@ -447,10 +447,13 @@ get_nt_native_path (const char *path, UNICODE_STRING& upath, bool dos)
          str2uni_cat (upath, path);
          /* The drive letter must be upper case. */
          upath.Buffer[4] = towupper (upath.Buffer[4]);
+         transform_chars (&upath, 7);
+       }
+      else                     /* relative path */
+       {
+         str2uni_cat (upath, path);
+         transform_chars (&upath, 0);
        }
-      else
-       str2uni_cat (upath, path);
-      transform_chars (&upath, 7);
     }
   else if (path[1] != '\\')    /* \Device\... */
     str2uni_cat (upath, path);
This page took 0.036505 seconds and 5 git commands to generate.