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

Alexandre Julliard julliard at winehq.org
Tue Sep 23 09:29:06 CDT 2008


Module: wine
Branch: master
Commit: ed9cd3ede2931b148ddbe45645284da1026957e8
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=ed9cd3ede2931b148ddbe45645284da1026957e8

Author: Rob Shearman <robertshearman at gmail.com>
Date:   Tue Sep 23 13:32:00 2008 +0100

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

Logical and should have been used instead.

---

 dlls/msvcrt/dir.c     |    4 ++--
 dlls/msvcrt/process.c |    2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/dlls/msvcrt/dir.c b/dlls/msvcrt/dir.c
index 0a28c59..5859adf 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 87a29f4..9dbc43e 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';




More information about the wine-cvs mailing list