Fix ranges with multibyte characters as endpoints.
commit1960ded78b85a1661d847c4b071c62915635a761
authorPaolo Bonzini <bonzini@gnu.org>
Wed, 18 Nov 2009 00:23:24 +0000 (17 16:23 -0800)
committerPetr Baudis <pasky@ucw.cz>
Wed, 18 Nov 2009 09:09:58 +0000 (18 10:09 +0100)
tree34a053da9cb3d4f4ec94c43cfb820e05e693a851
parentb39591e9c1c156a080563d60450d5fdb7971457c
Fix ranges with multibyte characters as endpoints.

This is another bug in computing the fastmap.  It was reported by a user
of sed because it usually does not happen with !_LIBC.  However, it is
there in that case too.

The bug is that whenever we have a range at the beginning of the regex,
the regex must be tested on any possible multibyte character.  The reason
why _LIBC masks it, is that in general there is a collation symbol for
each possible multibyte-character lead byte, so all the lead bytes are
in general already part of the fastmap.

The tests use cyrillic characters as an example.  With _LIBC, they pass
without the patch too, but you can make them fail by removing collation
symbols handling.

(cherry picked from commit 815d8147a3418334ffa91e2384c6e159f0809d65)
ChangeLog
posix/Makefile
posix/bug-regex30.c [new file with mode: 0644]
posix/regcomp.c