Commit ed9cd3ed authored by Rob Shearman's avatar Rob Shearman Committed by Alexandre Julliard

msvcrt: Fix mutual exclusion over logical or is always a non-zero constant.

Logical and should have been used instead.
parent 62a1beeb
......@@ -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';
......
......@@ -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';
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment