ntdll: Always add path separator when looking for a relative path name.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=47979
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
stable
Alexandre Julliard 2019-10-22 09:57:00 +02:00
parent 98c2c9a9c9
commit e4595a0ce8
1 changed files with 5 additions and 4 deletions

View File

@ -2705,19 +2705,20 @@ static NTSTATUS lookup_unix_name( const WCHAR *name, int name_len, char **buffer
/* try a shortcut first */
ret = ntdll_wcstoumbs( 0, name, name_len, unix_name + pos, unix_len - pos - 1,
NULL, &used_default );
while (name_len && IS_SEPARATOR(*name))
{
name++;
name_len--;
}
unix_name[pos] = '/';
ret = ntdll_wcstoumbs( 0, name, name_len, unix_name + pos + 1, unix_len - pos - 2,
NULL, &used_default );
if (ret >= 0 && !used_default) /* if we used the default char the name didn't convert properly */
{
char *p;
unix_name[pos + ret] = 0;
unix_name[pos + 1 + ret] = 0;
for (p = unix_name + pos ; *p; p++) if (*p == '\\') *p = '/';
if (!name_len || !redirect || (!strstr( unix_name, "/windows/") && strncmp( unix_name, "windows/", 8 )))
{