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

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


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

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

explorer: 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>

---

 programs/explorer/desktop.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/programs/explorer/desktop.c b/programs/explorer/desktop.c
index 7a8252f..4088dd4 100644
--- a/programs/explorer/desktop.c
+++ b/programs/explorer/desktop.c
@@ -903,6 +903,11 @@ static void set_desktop_window_title( HWND hwnd, const WCHAR *name )
     HeapFree( GetProcessHeap(), 0, window_titleW );
 }
 
+static inline BOOL is_whitespace(WCHAR c)
+{
+    return c == ' ' || c == '\t';
+}
+
 /* main desktop management function */
 void manage_desktop( WCHAR *arg )
 {
@@ -919,11 +924,11 @@ void manage_desktop( WCHAR *arg )
     BOOL enable_shell = FALSE;
 
     /* get the rest of the command line (if any) */
-    while (*p && !isspace(*p)) p++;
+    while (*p && !is_whitespace(*p)) p++;
     if (*p)
     {
         *p++ = 0;
-        while (*p && isspace(*p)) p++;
+        while (*p && is_whitespace(*p)) p++;
         if (*p) cmdline = p;
     }
 




More information about the wine-cvs mailing list