After removing collation for [a-z] ranges in r302512, do it here too.

Instead of trying to expand whole range at regcomp() stage as we do,
GNU regex allocates separate ranges [start,end] set each character
is checked against, so collation is possible and turned on for ranges here.

When something like that will be implemented or our obsoleted regex code
will be replaced to something like TRE, and in case we decide to use
collation in [a-z] ranges, all changes related to r302512 can be backed out,
but now we need consistency.
This commit is contained in:
Andrey A. Chernov 2016-07-13 19:02:59 +00:00
parent f04b8af8fa
commit ea81c8d0ef

View File

@ -2547,8 +2547,13 @@ match_mb_charset (struct dfa *d, int s, position pos, int index)
wcbuf[2] = work_mbc->range_sts[i];
wcbuf[4] = work_mbc->range_ends[i];
#ifdef __FreeBSD__
if (wcscmp(wcbuf, wcbuf+2) >= 0 &&
wcscmp(wcbuf+4, wcbuf) >= 0)
#else
if (wcscoll(wcbuf, wcbuf+2) >= 0 &&
wcscoll(wcbuf+4, wcbuf) >= 0)
#endif
goto charset_matched;
}