mirror of
https://github.com/reactos/reactos.git
synced 2025-02-22 16:36:33 +00:00
[CRT]
- 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:
parent
91a95100ef
commit
acfa6d7f15
4 changed files with 6 additions and 3 deletions
2
reactos/lib/3rdparty/libwine/CMakeLists.txt
vendored
2
reactos/lib/3rdparty/libwine/CMakeLists.txt
vendored
|
@ -8,7 +8,7 @@ list(APPEND SOURCE
|
|||
isinf.c
|
||||
isnan.c
|
||||
loader.c
|
||||
wctype.c
|
||||
../../sdk/crt/string/wctype.c
|
||||
register.c
|
||||
# string.c implements _stricmp, already shipped with crt
|
||||
)
|
||||
|
|
|
@ -281,6 +281,7 @@ list(APPEND CRT_SOURCE
|
|||
string/wcs.c
|
||||
string/wcstol.c
|
||||
string/wcstoul.c
|
||||
string/wctype.c
|
||||
string/wsplitp.c
|
||||
string/wtoi.c
|
||||
string/wtoi64.c
|
||||
|
|
|
@ -551,6 +551,8 @@ const unsigned short _wctype[] = {
|
|||
const unsigned short *_pctype = _ctype + 1;
|
||||
const unsigned short *_pwctype = _wctype + 1;
|
||||
|
||||
extern const unsigned short wine_wctype_table[];
|
||||
|
||||
/*
|
||||
* @implemented
|
||||
*/
|
||||
|
@ -587,7 +589,7 @@ int _isctype (int c, int ctypeFlags)
|
|||
*/
|
||||
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)
|
||||
{
|
||||
return (_pwctype[(unsigned char)(wc & 0xFF)] & wctypeFlags);
|
||||
return (wine_wctype_table[wine_wctype_table[wc >> 8] + (wc & 0xff)] & wctypeFlags);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Reference in a new issue