Module: wine Branch: master Commit: e4595a0ce8fd26d10d2bd47a310d1c1cf7bd953f URL: https://source.winehq.org/git/wine.git/?a=commit;h=e4595a0ce8fd26d10d2bd47a3...
Author: Alexandre Julliard julliard@winehq.org Date: Tue Oct 22 09:57:00 2019 +0200
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
---
dlls/ntdll/directory.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/dlls/ntdll/directory.c b/dlls/ntdll/directory.c index bdf2646f08..7554934701 100644 --- a/dlls/ntdll/directory.c +++ b/dlls/ntdll/directory.c @@ -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 ))) {