Akihiro Sagawa : shell32: Avoid using isspace() for WCHARs.

Alexandre Julliard julliard at winehq.org
Wed May 17 15:58:29 CDT 2017


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

Author: Akihiro Sagawa <sagawa.aki at gmail.com>
Date:   Wed May 17 21:35:42 2017 +0900

shell32: Avoid using isspace() for WCHARs.

Found with Coccinelle.

Signed-off-by: Akihiro Sagawa <sagawa.aki at gmail.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/shell32/shlexec.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/dlls/shell32/shlexec.c b/dlls/shell32/shlexec.c
index 474a1bc..c0ef53a 100644
--- a/dlls/shell32/shlexec.c
+++ b/dlls/shell32/shlexec.c
@@ -62,6 +62,10 @@ static const WCHAR wszEmpty[] = {0};
 typedef UINT_PTR (*SHELL_ExecuteW32)(const WCHAR *lpCmd, WCHAR *env, BOOL shWait,
 			    const SHELLEXECUTEINFOW *sei, LPSHELLEXECUTEINFOW sei_out);
 
+static inline BOOL isSpace(WCHAR c)
+{
+    return c == ' ' || c == '\f' || c == '\n' || c == '\r' || c == '\t' || c == '\v';
+}
 
 /***********************************************************************
  *	SHELL_ArgifyW [Internal]
@@ -135,7 +139,7 @@ static BOOL SHELL_ArgifyW(WCHAR* out, int len, const WCHAR* fmt, const WCHAR* lp
                     }
                     else
                     {
-                        while(*args && !isspace(*args))
+                        while(*args && !isSpace(*args))
                         {
                             used++;
                             if (used < len)
@@ -144,7 +148,7 @@ static BOOL SHELL_ArgifyW(WCHAR* out, int len, const WCHAR* fmt, const WCHAR* lp
                                 args++;
                         }
 
-                        while(isspace(*args))
+                        while(isSpace(*args))
                             ++args;
                     }
                     break;




More information about the wine-cvs mailing list