From c0b6c25146f1f42c0c986729cc137883ab91aaa8 Mon Sep 17 00:00:00 2001 From: Hamid Reza Arzaghi Date: Fri, 25 Sep 2020 00:21:55 +0330 Subject: [PATCH 1/2] treat blank as a special case --- stl/inc/xlocale | 3 +++ 1 file changed, 3 insertions(+) diff --git a/stl/inc/xlocale b/stl/inc/xlocale index 3f2a2a488de..d96bb1afd95 100644 --- a/stl/inc/xlocale +++ b/stl/inc/xlocale @@ -2611,6 +2611,9 @@ public: using char_type = _Elem; bool __CLR_OR_THIS_CALL is(mask _Maskval, _Elem _Ch) const { // test if element fits any mask classifications + if (_Maskval == blank) { + return _isblank_l(_Ch, _get_current_locale()) != 0; + } return (_Ctype._Table[static_cast(_Ch)] & _Maskval) != 0; } From 4dff0b6739340bd425b63e73dc21c2569b7dfa83 Mon Sep 17 00:00:00 2001 From: Hamid Reza Arzaghi Date: Sun, 27 Sep 2020 02:58:39 +0330 Subject: [PATCH 2/2] try to pass regex tests --- stl/inc/regex | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/stl/inc/regex b/stl/inc/regex index 2cfb6d8de33..3c70e9955cd 100644 --- a/stl/inc/regex +++ b/stl/inc/regex @@ -298,11 +298,13 @@ public: } bool isctype(_Elem _Ch, char_class_type _Fx) const { - if (_Fx != static_cast(-1)) { - return _Getctype()->is(_Fx, _Ch); - } else { + if (_Fx == static_cast(_Ch_blank)) { + return _Getctype()->is(_SP, _Ch) || _Getctype()->is(_CN, _Ch); + } else if (_Fx == static_cast(-1)) { return _Ch == '_' // assumes L'_' == '_' || _Getctype()->is(_Ch_alnum, _Ch); + } else { + return _Getctype()->is(_Fx, _Ch); } }