diff --git a/dlls/msvcrt/dir.c b/dlls/msvcrt/dir.c index 0a28c595c4f..5859adf832d 100644 --- a/dlls/msvcrt/dir.c +++ b/dlls/msvcrt/dir.c @@ -990,7 +990,7 @@ void CDECL _searchenv(const char* file, const char* env, char *buf) return; } memcpy(curPath, penv, end - penv); - if (curPath[end - penv] != '/' || curPath[end - penv] != '\\') + if (curPath[end - penv] != '/' && curPath[end - penv] != '\\') { curPath[end - penv] = '\\'; curPath[end - penv + 1] = '\0'; @@ -1053,7 +1053,7 @@ void CDECL _wsearchenv(const MSVCRT_wchar_t* file, const MSVCRT_wchar_t* env, MS return; } memcpy(curPath, penv, (end - penv) * sizeof(MSVCRT_wchar_t)); - if (curPath[end - penv] != '/' || curPath[end - penv] != '\\') + if (curPath[end - penv] != '/' && curPath[end - penv] != '\\') { curPath[end - penv] = '\\'; curPath[end - penv + 1] = '\0'; diff --git a/dlls/msvcrt/process.c b/dlls/msvcrt/process.c index 87a29f47a3b..9dbc43edb34 100644 --- a/dlls/msvcrt/process.c +++ b/dlls/msvcrt/process.c @@ -96,7 +96,7 @@ static void msvcrt_search_executable(const MSVCRT_wchar_t *name, MSVCRT_wchar_t if (path_len + name_len <= MAX_PATH - 2) { memcpy(buffer, env, path_len * sizeof(MSVCRT_wchar_t)); - if (buffer[path_len] != '/' || buffer[path_len] != '\\') + if (buffer[path_len] != '/' && buffer[path_len] != '\\') { buffer[path_len++] = '\\'; buffer[path_len] = '\0';