- Use wine's wctype table in CRT for iswctype() function. Previous implementation was returning incorrect information for non-Latin characters. Problem found and fixed by Sergey Shamanaev (seven_ro).
- Move wctype.c from libwine to lib/sdk/crt instead of making yet another copy of it (currently there is one more in tools/unicode). Suggested by Amine Khaldi.
See issue #5090 for more details.

svn path=/trunk/; revision=57119
This commit is contained in:
Aleksey Bragin 2012-08-20 17:20:48 +00:00
parent 91a95100ef
commit acfa6d7f15
4 changed files with 6 additions and 3 deletions

View file

@ -8,7 +8,7 @@ list(APPEND SOURCE
isinf.c isinf.c
isnan.c isnan.c
loader.c loader.c
wctype.c ../../sdk/crt/string/wctype.c
register.c register.c
# string.c implements _stricmp, already shipped with crt # string.c implements _stricmp, already shipped with crt
) )

View file

@ -281,6 +281,7 @@ list(APPEND CRT_SOURCE
string/wcs.c string/wcs.c
string/wcstol.c string/wcstol.c
string/wcstoul.c string/wcstoul.c
string/wctype.c
string/wsplitp.c string/wsplitp.c
string/wtoi.c string/wtoi.c
string/wtoi64.c string/wtoi64.c

View file

@ -551,6 +551,8 @@ const unsigned short _wctype[] = {
const unsigned short *_pctype = _ctype + 1; const unsigned short *_pctype = _ctype + 1;
const unsigned short *_pwctype = _wctype + 1; const unsigned short *_pwctype = _wctype + 1;
extern const unsigned short wine_wctype_table[];
/* /*
* @implemented * @implemented
*/ */
@ -587,7 +589,7 @@ int _isctype (int c, int ctypeFlags)
*/ */
int iswctype(wint_t wc, wctype_t wctypeFlags) int iswctype(wint_t wc, wctype_t wctypeFlags)
{ {
return (_pwctype[(unsigned char)(wc & 0xFF)] & wctypeFlags); return (wine_wctype_table[wine_wctype_table[wc >> 8] + (wc & 0xff)] & wctypeFlags);
} }
/* /*
@ -597,7 +599,7 @@ int iswctype(wint_t wc, wctype_t wctypeFlags)
*/ */
int is_wctype(wint_t wc, wctype_t wctypeFlags) int is_wctype(wint_t wc, wctype_t wctypeFlags)
{ {
return (_pwctype[(unsigned char)(wc & 0xFF)] & wctypeFlags); return (wine_wctype_table[wine_wctype_table[wc >> 8] + (wc & 0xff)] & wctypeFlags);
} }
/* /*