diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2018-08-10 11:41:22 +0300 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2018-08-10 11:41:22 +0300 |
commit | bdcad8e531d886fb0074b1239ced50ee1cd5252e (patch) | |
tree | 7608664746fde9597072f381c777af1c99421e33 /support/regcomp.c | |
parent | 710cbed410c7507e665af95b511a121ce044ccdc (diff) | |
download | egawk-bdcad8e531d886fb0074b1239ced50ee1cd5252e.tar.gz egawk-bdcad8e531d886fb0074b1239ced50ee1cd5252e.tar.bz2 egawk-bdcad8e531d886fb0074b1239ced50ee1cd5252e.zip |
Sync with gnulib.
Diffstat (limited to 'support/regcomp.c')
-rw-r--r-- | support/regcomp.c | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/support/regcomp.c b/support/regcomp.c index 7b5ddaad..3b0a3c6b 100644 --- a/support/regcomp.c +++ b/support/regcomp.c @@ -3531,18 +3531,10 @@ build_equiv_class (bitset_t sbcset, const unsigned char *name) continue; /* Compare only if the length matches and the collation rule index is the same. */ - if (len == weights[idx2 & 0xffffff] && (idx1 >> 24) == (idx2 >> 24)) - { - int cnt = 0; - - while (cnt <= len && - weights[(idx1 & 0xffffff) + 1 + cnt] - == weights[(idx2 & 0xffffff) + 1 + cnt]) - ++cnt; - - if (cnt > len) - bitset_set (sbcset, ch); - } + if (len == weights[idx2 & 0xffffff] && (idx1 >> 24) == (idx2 >> 24) + && memcmp (weights + (idx1 & 0xffffff) + 1, + weights + (idx2 & 0xffffff) + 1, len) == 0) + bitset_set (sbcset, ch); } /* Check whether the array has enough space. */ if (BE (*equiv_class_alloc == mbcset->nequiv_classes, 0)) @@ -3802,9 +3794,9 @@ free_charset (re_charset_t *cset) # ifdef _LIBC re_free (cset->coll_syms); re_free (cset->equiv_classes); +# endif re_free (cset->range_starts); re_free (cset->range_ends); -# endif re_free (cset->char_classes); re_free (cset); } |