diff options
| author | Maxime Coste <frrrwww@gmail.com> | 2016-05-19 21:45:23 +0100 |
|---|---|---|
| committer | Maxime Coste <frrrwww@gmail.com> | 2016-05-19 21:45:23 +0100 |
| commit | 1834a67b87b7a8f6a9108721910e8be192471211 (patch) | |
| tree | 4784c9a83e7533b6afc2eaadf890fa9ca8ba952a /src/ranked_match.cc | |
| parent | e1703204f8ca8e6cbc55ef609be99816ae5ec6d6 (diff) | |
Go back to libc locale and use c_regex_traits
Unfortunately, cygwin does not support c++ locales.
Diffstat (limited to 'src/ranked_match.cc')
| -rw-r--r-- | src/ranked_match.cc | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/ranked_match.cc b/src/ranked_match.cc index 77025219..a6145d62 100644 --- a/src/ranked_match.cc +++ b/src/ranked_match.cc @@ -34,7 +34,6 @@ using Utf8It = utf8::iterator<const char*>; static int count_word_boundaries_match(StringView candidate, StringView query) { - std::locale locale; int count = 0; Utf8It query_it{query.begin(), query}; Codepoint prev = 0; @@ -42,10 +41,8 @@ static int count_word_boundaries_match(StringView candidate, StringView query) { const Codepoint c = *it; const bool is_word_boundary = prev == 0 or - (!std::isalnum((wchar_t)prev, locale) and - std::isalnum((wchar_t)c, locale)) or - (std::islower((wchar_t)prev, locale) and - std::isupper((wchar_t)c, locale)); + (!iswalnum((wchar_t)prev) and iswalnum((wchar_t)c)) or + (iswlower((wchar_t)prev) and iswupper((wchar_t)c)); prev = c; if (not is_word_boundary) |
