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>
This commit is contained in:
Corinna Vinschen 2016-07-14 20:52:04 +02:00
parent 6795ef7d37
commit fe9e3b4498
1 changed files with 6 additions and 3 deletions

View File

@ -447,11 +447,14 @@ get_nt_native_path (const char *path, UNICODE_STRING& upath, bool dos)
str2uni_cat (upath, path); str2uni_cat (upath, path);
/* The drive letter must be upper case. */ /* The drive letter must be upper case. */
upath.Buffer[4] = towupper (upath.Buffer[4]); upath.Buffer[4] = towupper (upath.Buffer[4]);
}
else
str2uni_cat (upath, path);
transform_chars (&upath, 7); transform_chars (&upath, 7);
} }
else /* relative path */
{
str2uni_cat (upath, path);
transform_chars (&upath, 0);
}
}
else if (path[1] != '\\') /* \Device\... */ else if (path[1] != '\\') /* \Device\... */
str2uni_cat (upath, path); str2uni_cat (upath, path);
else if ((path[2] != '.' && path[2] != '?') else if ((path[2] != '.' && path[2] != '?')