parser: adopt changes from string
Signed-off-by: Simon Rozman <simon@rozman.si>
This commit is contained in:
parent
434cf6d3e2
commit
aedb0921f2
@ -718,11 +718,11 @@ namespace stdex
|
|||||||
assert(text || start >= end);
|
assert(text || start >= end);
|
||||||
if (start < end && text[start]) {
|
if (start < end && text[start]) {
|
||||||
const T* set = m_set.c_str();
|
const T* set = m_set.c_str();
|
||||||
const T* r = (flags & match_case_insensitive) ?
|
size_t r = (flags & match_case_insensitive) ?
|
||||||
stdex::strnichr(set, text[start], m_set.size(), m_locale) :
|
stdex::strnichr(set, m_set.size(), text[start], m_locale) :
|
||||||
stdex::strnchr(set, text[start], m_set.size());
|
stdex::strnchr(set, m_set.size(), text[start]);
|
||||||
if (r && !m_invert || !r && m_invert) {
|
if (r != stdex::npos && !m_invert || r == stdex::npos && m_invert) {
|
||||||
hit_offset = r ? r - set : (size_t)-1;
|
hit_offset = r;
|
||||||
interval.end = (interval.start = start) + 1;
|
interval.end = (interval.start = start) + 1;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -768,11 +768,11 @@ namespace stdex
|
|||||||
wchar_t buf[3];
|
wchar_t buf[3];
|
||||||
const wchar_t* chr = next_sgml_cp(text, start, end, interval.end, buf);
|
const wchar_t* chr = next_sgml_cp(text, start, end, interval.end, buf);
|
||||||
const wchar_t* set = m_set.c_str();
|
const wchar_t* set = m_set.c_str();
|
||||||
const wchar_t* r = (flags & match_case_insensitive) ?
|
size_t r = (flags & match_case_insensitive) ?
|
||||||
stdex::strnistr(set, chr, m_set.size(), m_locale) :
|
stdex::strnistr(set, m_set.size(), chr, m_locale) :
|
||||||
stdex::strnstr(set, chr, m_set.size());
|
stdex::strnstr(set, m_set.size(), chr);
|
||||||
if (r && !m_invert || !r && m_invert) {
|
if (r != stdex::npos && !m_invert || r == stdex::npos && m_invert) {
|
||||||
hit_offset = r ? r - set : (size_t)-1;
|
hit_offset = r;
|
||||||
interval.start = start;
|
interval.start = start;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user