diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2016-07-14 20:52:04 +0200 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2016-07-14 20:52:04 +0200 |
commit | fe9e3b4498ab7b3260f5e326cad77e21d5c2293c (patch) | |
tree | 1c328c8d386c275d7db11afb7c123be4afb4f6aa /winsup/cygwin/path.cc | |
parent | 6795ef7d3793ca3e8528a56e41d5322c57d58a3c (diff) | |
download | cygnal-fe9e3b4498ab7b3260f5e326cad77e21d5c2293c.tar.gz cygnal-fe9e3b4498ab7b3260f5e326cad77e21d5c2293c.tar.bz2 cygnal-fe9e3b4498ab7b3260f5e326cad77e21d5c2293c.zip |
Transform all special chars in relative Windows path string
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>
Diffstat (limited to 'winsup/cygwin/path.cc')
-rw-r--r-- | winsup/cygwin/path.cc | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc index 7373fb72d..970a0fec4 100644 --- a/winsup/cygwin/path.cc +++ b/winsup/cygwin/path.cc @@ -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); |