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

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alexandre Julliard 2020-03-31 11:46:29 +02:00
parent 6de0ab276b
commit 667fbe8791
2 changed files with 6 additions and 5 deletions

View File

@ -845,7 +845,7 @@ static LCID unix_locale_to_lcid( const char *unix_name )
if (len == ARRAY_SIZE(buffer)) return 0; if (len == ARRAY_SIZE(buffer)) return 0;
buffer[len] = 0; buffer[len] = 0;
if (!(p = strpbrkW( buffer, sepW ))) if (!(p = wcspbrk( buffer, sepW )))
{ {
if (!strcmpW( buffer, posixW ) || !strcmpW( buffer, cW )) if (!strcmpW( buffer, posixW ) || !strcmpW( buffer, cW ))
return MAKELCID( MAKELANGID(LANG_ENGLISH,SUBLANG_DEFAULT), SORT_DEFAULT ); 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; *p++ = 0;
country = p; country = p;
p = strpbrkW( p, sepW + 1 ); p = wcspbrk( p, sepW + 1 );
} }
if (p && *p == '.') 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; if (strlenW( name ) >= LOCALE_NAME_MAX_LENGTH) return STATUS_INVALID_PARAMETER_1;
wcscpy( lang, name ); wcscpy( lang, name );
if ((p = strpbrkW( lang, sepW )) && *p == '-') if ((p = wcspbrk( lang, sepW )) && *p == '-')
{ {
*p++ = 0; *p++ = 0;
country = p; country = p;
if ((p = strpbrkW( p, sepW )) && *p == '-') if ((p = wcspbrk( p, sepW )) && *p == '-')
{ {
*p++ = 0; *p++ = 0;
script = country; script = country;
country = p; country = p;
p = strpbrkW( p, sepW ); p = wcspbrk( p, sepW );
} }
if (p) *p = 0; /* FIXME: modifier is ignored */ if (p) *p = 0; /* FIXME: modifier is ignored */
/* second value can be script or country, check length to resolve the ambiguity */ /* second value can be script or country, check length to resolve the ambiguity */

View File

@ -305,6 +305,7 @@ int WINAPIV NTDLL_swprintf( WCHAR *str, const WCHAR *format, ... );
#define wcscpy(d,s) NTDLL_wcscpy(d,s) #define wcscpy(d,s) NTDLL_wcscpy(d,s)
#define wcscat(d,s) NTDLL_wcscat(d,s) #define wcscat(d,s) NTDLL_wcscat(d,s)
#define wcschr(s,c) NTDLL_wcschr(s,c) #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) #define wcstoul(s,e,b) NTDLL_wcstoul(s,e,b)
/* convert from straight ASCII to Unicode without depending on the current codepage */ /* convert from straight ASCII to Unicode without depending on the current codepage */