Piotr Caban : msvcrt: Use _stricmp instead of strcasecmp.

Alexandre Julliard julliard at winehq.org
Tue Mar 26 16:43:14 CDT 2019


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

Author: Piotr Caban <piotr at codeweavers.com>
Date:   Tue Mar 26 11:31:09 2019 +0100

msvcrt: Use _stricmp instead of strcasecmp.

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

---

 dlls/msvcrt/locale.c | 10 +++++-----
 dlls/msvcrt/mbcs.c   |  2 +-
 dlls/msvcrt/msvcrt.h |  1 +
 dlls/msvcrt/string.c |  2 +-
 4 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/dlls/msvcrt/locale.c b/dlls/msvcrt/locale.c
index 4282fed..1e05711 100644
--- a/dlls/msvcrt/locale.c
+++ b/dlls/msvcrt/locale.c
@@ -97,7 +97,7 @@ static void remap_synonym(char *name)
   unsigned int i;
   for (i = 0; i < ARRAY_SIZE(_country_synonyms); i += 2)
   {
-    if (!strcasecmp(_country_synonyms[i],name))
+    if (!MSVCRT__stricmp(_country_synonyms[i],name))
     {
       TRACE(":Mapping synonym %s to %s\n",name,_country_synonyms[i+1]);
       strcpy(name, _country_synonyms[i+1]);
@@ -140,7 +140,7 @@ static int compare_info(LCID lcid, DWORD flags, char* buff, const char* cmp, BOO
   /* Partial matches are only allowed on language/country names */
   len = strlen(cmp);
   if(exact || len<=3)
-    return !strcasecmp(cmp, buff);
+    return !MSVCRT__stricmp(cmp, buff);
   else
     return !strncasecmp(cmp, buff, len);
 }
@@ -264,7 +264,7 @@ LCID MSVCRT_locale_to_LCID(const char *locale, unsigned short *codepage, BOOL *s
     if(!search.search_country[0] && !search.search_codepage[0])
         remap_synonym(search.search_language);
 
-    if(!strcasecmp(search.search_country, "China"))
+    if(!MSVCRT__stricmp(search.search_country, "China"))
         strcpy(search.search_country, "People's Republic of China");
 
     EnumResourceLanguagesA(GetModuleHandleA("KERNEL32"), (LPSTR)RT_STRING,
@@ -291,10 +291,10 @@ LCID MSVCRT_locale_to_LCID(const char *locale, unsigned short *codepage, BOOL *s
                 memcpy(search.found_codepage,search.search_codepage,MAX_ELEM_LEN);
             else {
                 /* Special codepage values: OEM & ANSI */
-                if (!strcasecmp(search.search_codepage,"OCP")) {
+                if (!MSVCRT__stricmp(search.search_codepage,"OCP")) {
                     GetLocaleInfoA(lcid, LOCALE_IDEFAULTCODEPAGE,
                             search.found_codepage, MAX_ELEM_LEN);
-                } else if (!strcasecmp(search.search_codepage,"ACP")) {
+                } else if (!MSVCRT__stricmp(search.search_codepage,"ACP")) {
                     GetLocaleInfoA(lcid, LOCALE_IDEFAULTANSICODEPAGE,
                             search.found_codepage, MAX_ELEM_LEN);
                 } else
diff --git a/dlls/msvcrt/mbcs.c b/dlls/msvcrt/mbcs.c
index 918fff8..bc528f1 100644
--- a/dlls/msvcrt/mbcs.c
+++ b/dlls/msvcrt/mbcs.c
@@ -123,7 +123,7 @@ static inline int u_strcmp( const unsigned char *s1, const unsigned char *s2 )
 
 static inline int u_strcasecmp( const unsigned char *s1, const unsigned char *s2 )
 {
-  return strcasecmp( (const char*)s1, (const char*)s2 );
+  return MSVCRT__stricmp( (const char*)s1, (const char*)s2 );
 }
 
 static inline int u_strncmp( const unsigned char *s1, const unsigned char *s2, MSVCRT_size_t len )
diff --git a/dlls/msvcrt/msvcrt.h b/dlls/msvcrt/msvcrt.h
index ed12dee..10f3dc1 100644
--- a/dlls/msvcrt/msvcrt.h
+++ b/dlls/msvcrt/msvcrt.h
@@ -1148,6 +1148,7 @@ int __cdecl      MSVCRT__toupper_l(int,MSVCRT__locale_t);
 int __cdecl      MSVCRT__tolower_l(int,MSVCRT__locale_t);
 int __cdecl      MSVCRT__towupper_l(MSVCRT_wint_t,MSVCRT__locale_t);
 int __cdecl      MSVCRT__towlower_l(MSVCRT_wint_t,MSVCRT__locale_t);
+int __cdecl      MSVCRT__stricmp(const char*, const char*);
 int __cdecl      MSVCRT__strnicmp(const char*, const char*, MSVCRT_size_t);
 int __cdecl      MSVCRT__strnicoll_l(const char*, const char*, MSVCRT_size_t, MSVCRT__locale_t);
 int __cdecl      MSVCRT__strncoll_l(const char*, const char*, MSVCRT_size_t, MSVCRT__locale_t);
diff --git a/dlls/msvcrt/string.c b/dlls/msvcrt/string.c
index 219ce50..17eee1c 100644
--- a/dlls/msvcrt/string.c
+++ b/dlls/msvcrt/string.c
@@ -641,7 +641,7 @@ int CDECL MSVCRT__stricoll_l( const char* str1, const char* str2, MSVCRT__locale
         locinfo = locale->locinfo;
 
     if(!locinfo->lc_handle[MSVCRT_LC_COLLATE])
-        return strcasecmp(str1, str2);
+        return MSVCRT__stricmp(str1, str2);
     return CompareStringA(locinfo->lc_handle[MSVCRT_LC_COLLATE], NORM_IGNORECASE,
             str1, -1, str2, -1)-CSTR_EQUAL;
 }




More information about the wine-cvs mailing list