Skip to content

Commit

Permalink
Back out non-collating [a-z] ranges.
Browse files Browse the repository at this point in the history
Instead of changing the whole course to another POSIX-permitted way
for consistency and uniformity I decide to completely ignore missing
regex fucntionality and focus on fixing bugs in what we have now,
too many small obstacles we have choicing other way, counting ports.
Corresponding libc changes are backed out in r302824.
  • Loading branch information
Andrey A. Chernov authored and Andrey A. Chernov committed Jul 14, 2016
1 parent 2219fc0 commit 2fb2dbe
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 14 deletions.
9 changes: 0 additions & 9 deletions contrib/libgnuregex/regcomp.c
Original file line number Diff line number Diff line change
Expand Up @@ -2664,11 +2664,7 @@ build_range_exp (bitset_t sbcset, bracket_elem_t *start_elem,
return REG_ECOLLATE;
cmp_buf[0] = start_wc;
cmp_buf[4] = end_wc;
#ifdef __FreeBSD__
if (wcscmp (cmp_buf, cmp_buf + 4) > 0)
#else
if (wcscoll (cmp_buf, cmp_buf + 4) > 0)
#endif
return REG_ERANGE;

/* Got valid collation sequence values, add them as a new entry.
Expand Down Expand Up @@ -2710,13 +2706,8 @@ build_range_exp (bitset_t sbcset, bracket_elem_t *start_elem,
for (wc = 0; wc < SBC_MAX; ++wc)
{
cmp_buf[2] = wc;
#ifdef __FreeBSD__
if (wcscmp (cmp_buf, cmp_buf + 2) <= 0
&& wcscmp (cmp_buf + 2, cmp_buf + 4) <= 0)
#else
if (wcscoll (cmp_buf, cmp_buf + 2) <= 0
&& wcscoll (cmp_buf + 2, cmp_buf + 4) <= 0)
#endif
bitset_set (sbcset, wc);
}
}
Expand Down
5 changes: 0 additions & 5 deletions contrib/libgnuregex/regexec.c
Original file line number Diff line number Diff line change
Expand Up @@ -3964,13 +3964,8 @@ check_node_accept_bytes (const re_dfa_t *dfa, int node_idx,
{
cmp_buf[0] = cset->range_starts[i];
cmp_buf[4] = cset->range_ends[i];
#ifdef __FreeBSD__
if (wcscmp (cmp_buf, cmp_buf + 2) <= 0
&& wcscmp (cmp_buf + 2, cmp_buf + 4) <= 0)
#else
if (wcscoll (cmp_buf, cmp_buf + 2) <= 0
&& wcscoll (cmp_buf + 2, cmp_buf + 4) <= 0)
#endif
{
match_len = char_len;
goto check_node_accept_bytes_match;
Expand Down

0 comments on commit 2fb2dbe

Please sign in to comment.