Mercurial > gnulib
diff lib/regcomp.c @ 39758:962b2c119f26
autoupdate
author | Paul Eggert <eggert@cs.ucla.edu> |
---|---|
date | Wed, 01 Aug 2018 13:26:38 -0700 |
parents | 12587fb7c818 |
children | dfd69627235c |
line wrap: on
line diff
--- a/lib/regcomp.c Fri Jul 27 11:29:17 2018 +0200 +++ b/lib/regcomp.c Wed Aug 01 13:26:38 2018 -0700 @@ -3531,18 +3531,10 @@ 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 @@ # 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); }