Piotr Caban : winex11.drv: Don't use strcasecmp.

Alexandre Julliard julliard at winehq.org
Wed Apr 3 15:26:20 CDT 2019


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

Author: Piotr Caban <piotr at codeweavers.com>
Date:   Wed Apr  3 18:23:18 2019 +0200

winex11.drv: Don't use strcasecmp.

Signed-off-by: Piotr Caban <piotr at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/winex11.drv/keyboard.c | 2 +-
 dlls/winex11.drv/xim.c      | 7 ++++---
 dlls/winex11.drv/xrender.c  | 2 +-
 3 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/dlls/winex11.drv/keyboard.c b/dlls/winex11.drv/keyboard.c
index b9b8293..3b8d916 100644
--- a/dlls/winex11.drv/keyboard.c
+++ b/dlls/winex11.drv/keyboard.c
@@ -2334,7 +2334,7 @@ INT CDECL X11DRV_GetKeyNameText(LONG lParam, LPWSTR lpBuffer, INT nSize)
       if (name && (vkey == VK_SHIFT || vkey == VK_CONTROL || vkey == VK_MENU))
       {
           char* idx = strrchr(name, '_');
-          if (idx && (strcasecmp(idx, "_r") == 0 || strcasecmp(idx, "_l") == 0))
+          if (idx && (_strnicmp(idx, "_r", -1) == 0 || _strnicmp(idx, "_l", -1) == 0))
           {
               LeaveCriticalSection( &kbd_section );
               TRACE("found scan=%04x keyc=%u keysym=%lx modified_string=%s\n",
diff --git a/dlls/winex11.drv/xim.c b/dlls/winex11.drv/xim.c
index f6af293..44fe62e 100644
--- a/dlls/winex11.drv/xim.c
+++ b/dlls/winex11.drv/xim.c
@@ -28,6 +28,7 @@
 #include "winuser.h"
 #include "wingdi.h"
 #include "winnls.h"
+#include "winternl.h"
 #include "x11drv.h"
 #include "imm.h"
 #include "wine/debug.h"
@@ -293,11 +294,11 @@ void X11DRV_SetPreeditState(HWND hwnd, BOOL fOpen)
  */
 BOOL X11DRV_InitXIM( const char *input_style )
 {
-    if (!strcasecmp(input_style, "offthespot"))
+    if (!_strnicmp(input_style, "offthespot", -1))
         ximStyleRequest = STYLE_OFFTHESPOT;
-    else if (!strcasecmp(input_style, "overthespot"))
+    else if (!_strnicmp(input_style, "overthespot", -1))
         ximStyleRequest = STYLE_OVERTHESPOT;
-    else if (!strcasecmp(input_style, "root"))
+    else if (!_strnicmp(input_style, "root", -1))
         ximStyleRequest = STYLE_ROOT;
 
     if (!XSupportsLocale())
diff --git a/dlls/winex11.drv/xrender.c b/dlls/winex11.drv/xrender.c
index 4d04741..8350bad 100644
--- a/dlls/winex11.drv/xrender.c
+++ b/dlls/winex11.drv/xrender.c
@@ -800,7 +800,7 @@ static UINT get_xft_aa_flags( const LOGFONTW *lf )
         if (!(value = XGetDefault( gdi_display, "Xft", "antialias" ))) break;
         TRACE( "got antialias '%s'\n", value );
         if (tolower(value[0]) == 'f' || tolower(value[0]) == 'n' ||
-            value[0] == '0' || !strcasecmp( value, "off" ))
+            value[0] == '0' || !_strnicmp( value, "off", -1 ))
         {
             ret = GGO_BITMAP;
             break;




More information about the wine-cvs mailing list