regex: Fix fastmap for multibyte character ranges.
authorPaolo Bonzini <bonzini@gnu.org>
Wed, 25 Nov 2009 10:41:09 +0000 (11:41 +0100)
committerPaolo Bonzini <bonzini@gnu.org>
Wed, 25 Nov 2009 10:46:40 +0000 (11:46 +0100)
* lib/regcomp.c (re_compute_fastmap_iter): Add all multibyte lead
characters when a multibyte character range is included.

ChangeLog
lib/regcomp.c

index fcdf307..54c5514 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2009-11-25  Paolo Bonzini  <bonzini@gnu.org>
+
+       regex: Fix fastmap for multibyte character ranges.
+       * lib/regcomp.c (re_compute_fastmap_iter): Add all multibyte lead
+       characters when a multibyte character range is included.
+
 2009-11-22  Andy Wingo  <wingo@pobox.com>
 
        version-etc: work also with AM_INIT_AUTOMAKE's no-define option
index 6472ff6..6aef405 100644 (file)
@@ -383,7 +383,7 @@ re_compile_fastmap_iter (regex_t *bufp, const re_dfastate_t *init_state,
             applies to multibyte character sets; for single byte character
             sets, the SIMPLE_BRACKET again suffices.  */
          if (dfa->mb_cur_max > 1
-             && (cset->nchar_classes || cset->non_match
+             && (cset->nchar_classes || cset->non_match || cset->nranges
 # ifdef _LIBC
                  || cset->nequiv_classes
 # endif /* _LIBC */