From 99ad9db4e617a73b69217b935ca5a4785835ac1d Mon Sep 17 00:00:00 2001 From: akallabeth Date: Tue, 15 Nov 2022 10:52:34 +0100 Subject: [PATCH] [winpr,path] Fixed WCHAR and char mixup --- winpr/libwinpr/path/shell.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/winpr/libwinpr/path/shell.c b/winpr/libwinpr/path/shell.c index 58813bea0..5c4ffc731 100644 --- a/winpr/libwinpr/path/shell.c +++ b/winpr/libwinpr/path/shell.c @@ -526,7 +526,8 @@ BOOL PathMakePathW(LPCWSTR path, LPSECURITY_ATTRIBUTES lpAttributes) #elif defined(_WIN32) return (SHCreateDirectoryExW(NULL, path, lpAttributes) == ERROR_SUCCESS); #else - const WCHAR delim = PathGetSeparatorW(PATH_STYLE_NATIVE); + const WCHAR wdelim = PathGetSeparatorW(PATH_STYLE_NATIVE); + const char delim = PathGetSeparatorA(PATH_STYLE_NATIVE); char* dup; char* p; BOOL result = TRUE; @@ -538,7 +539,7 @@ BOOL PathMakePathW(LPCWSTR path, LPSECURITY_ATTRIBUTES lpAttributes) #else - if (!path || *path != delim) + if (!path || *path != wdelim) return FALSE; #endif @@ -548,7 +549,7 @@ BOOL PathMakePathW(LPCWSTR path, LPSECURITY_ATTRIBUTES lpAttributes) return FALSE; #ifdef __OS2__ - p = (strlen(dup) > 3) && (dup[1] == L':') && (dup[2] == delim)) ? &dup[3] : dup; + p = (strlen(dup) > 3) && (dup[1] == ':') && (dup[2] == delim)) ? &dup[3] : dup; while (p) #else