Alexandre Julliard : ntdll: Use wcspbrk() instead of strpbrkW().

Alexandre Julliard julliard at winehq.org
Tue Mar 31 16:44:22 CDT 2020


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

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Tue Mar 31 11:46:29 2020 +0200

ntdll: Use wcspbrk() instead of strpbrkW().

Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/ntdll/locale.c     | 10 +++++-----
 dlls/ntdll/ntdll_misc.h |  1 +
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/dlls/ntdll/locale.c b/dlls/ntdll/locale.c
index 6e885b0b2c..1206a54f22 100644
--- a/dlls/ntdll/locale.c
+++ b/dlls/ntdll/locale.c
@@ -845,7 +845,7 @@ static LCID unix_locale_to_lcid( const char *unix_name )
     if (len == ARRAY_SIZE(buffer)) return 0;
     buffer[len] = 0;
 
-    if (!(p = strpbrkW( buffer, sepW )))
+    if (!(p = wcspbrk( buffer, sepW )))
     {
         if (!strcmpW( buffer, posixW ) || !strcmpW( buffer, cW ))
             return MAKELCID( MAKELANGID(LANG_ENGLISH,SUBLANG_DEFAULT), SORT_DEFAULT );
@@ -857,7 +857,7 @@ static LCID unix_locale_to_lcid( const char *unix_name )
         {
             *p++ = 0;
             country = p;
-            p = strpbrkW( p, sepW + 1 );
+            p = wcspbrk( p, sepW + 1 );
         }
         if (p && *p == '.')
         {
@@ -1674,16 +1674,16 @@ NTSTATUS WINAPI RtlLocaleNameToLcid( const WCHAR *name, LCID *lcid, ULONG flags
     if (strlenW( name ) >= LOCALE_NAME_MAX_LENGTH) return STATUS_INVALID_PARAMETER_1;
     wcscpy( lang, name );
 
-    if ((p = strpbrkW( lang, sepW )) && *p == '-')
+    if ((p = wcspbrk( lang, sepW )) && *p == '-')
     {
         *p++ = 0;
         country = p;
-        if ((p = strpbrkW( p, sepW )) && *p == '-')
+        if ((p = wcspbrk( p, sepW )) && *p == '-')
         {
             *p++ = 0;
             script = country;
             country = p;
-            p = strpbrkW( p, sepW );
+            p = wcspbrk( p, sepW );
         }
         if (p) *p = 0;  /* FIXME: modifier is ignored */
         /* second value can be script or country, check length to resolve the ambiguity */
diff --git a/dlls/ntdll/ntdll_misc.h b/dlls/ntdll/ntdll_misc.h
index ca8d26ca82..e7df143cac 100644
--- a/dlls/ntdll/ntdll_misc.h
+++ b/dlls/ntdll/ntdll_misc.h
@@ -305,6 +305,7 @@ int    WINAPIV NTDLL_swprintf( WCHAR *str, const WCHAR *format, ... );
 #define wcscpy(d,s) NTDLL_wcscpy(d,s)
 #define wcscat(d,s) NTDLL_wcscat(d,s)
 #define wcschr(s,c) NTDLL_wcschr(s,c)
+#define wcspbrk(s,a) NTDLL_wcspbrk(s,a)
 #define wcstoul(s,e,b) NTDLL_wcstoul(s,e,b)
 
 /* convert from straight ASCII to Unicode without depending on the current codepage */




More information about the wine-cvs mailing list