Module: wine Branch: master Commit: 7a98557352f3d2734ddf23fa44e5161218982af0 URL: https://source.winehq.org/git/wine.git/?a=commit;h=7a98557352f3d2734ddf23fa4...
Author: Piotr Caban piotr@codeweavers.com Date: Mon Oct 18 14:57:46 2021 +0200
ucrtbase: Change _isblank_l return value for '\t'.
Signed-off-by: Piotr Caban piotr@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/msvcrt/ctype.c | 5 ++++- dlls/ucrtbase/tests/misc.c | 17 ++++++++++------- 2 files changed, 14 insertions(+), 8 deletions(-)
diff --git a/dlls/msvcrt/ctype.c b/dlls/msvcrt/ctype.c index 7cfba52c9f4..5a7d3450eda 100644 --- a/dlls/msvcrt/ctype.c +++ b/dlls/msvcrt/ctype.c @@ -397,7 +397,10 @@ int CDECL isxdigit(int c) */ int CDECL _isblank_l(int c, _locale_t locale) { - return c == '\t' || _isctype_l( c, _BLANK, locale ); +#if _MSVCR_VER < 140 + if (c == '\t') return _BLANK; +#endif + return _isctype_l( c, _BLANK, locale ); }
/********************************************************************* diff --git a/dlls/ucrtbase/tests/misc.c b/dlls/ucrtbase/tests/misc.c index f5dbac70ddb..60f569c69ff 100644 --- a/dlls/ucrtbase/tests/misc.c +++ b/dlls/ucrtbase/tests/misc.c @@ -538,16 +538,19 @@ static void test_lldiv(void)
static void test_isblank(void) { - int c; + int c, r;
for(c = 0; c <= 0xff; c++) { - if(c == '\t' || c == ' ') { - if(c == '\t') - ok(!_isctype(c, _BLANK), "tab shouldn't be blank\n"); - else - ok(_isctype(c, _BLANK), "space should be blank\n"); + if(c == '\t') { + ok(!_isctype(c, _BLANK), "tab shouldn't be blank\n"); + ok(isblank(c), "%d should be blank\n", c); + r = _isblank_l(c, NULL); + ok(!r || broken(r == _BLANK), "tab shouldn't be blank (got %x)\n", r); + } else if(c == ' ') { + ok(_isctype(c, _BLANK), "space should be blank\n"); ok(isblank(c), "%d should be blank\n", c); - ok(_isblank_l(c, NULL), "%d should be blank\n", c); + r = _isblank_l(c, NULL); + ok(r == _BLANK, "space should be blank (got %x)\n", r); } else { ok(!_isctype(c, _BLANK), "%d shouldn't be blank\n", c); ok(!isblank(c), "%d shouldn't be blank\n", c);