regex: Fix unicode othercasing
authorChristian Persch <chpe@gnome.org>
Sun, 17 Jun 2012 20:51:44 +0000 (22:51 +0200)
committerMatthias Clasen <mclasen@redhat.com>
Sat, 23 Jun 2012 21:32:15 +0000 (17:32 -0400)
commit53b48dfd3bce21fc6b52128859b01329efa10d52
tree54b0fa2e4ddb5184674fd30badef28b4fb5f41e8
parent22e9f72a8e23c9469c2891e48e082be664429dac
regex: Fix unicode othercasing

The old _pcre_ucp_othercase() function was wrong in returning
NOTACHAR (0xffffffff) for characters that aren't changed by upper-
and lower-casing. This led to PCRE internally using incorrect (or
at least inefficient) character classes when using G_REGEX_CASELESS.

E.g. [Z-\x{100}] turned into:

[Z\x{fffe}\x{fffe}\x{fffe}\x{fffe}\x{fffe}\x{fffe}\x{fffe}\x{fffe}\x{fffe}\x{fffe}\x{fffe}\x{fffe}\x{fffe}\x{fffe}\x{fffe}\x{fffe}\x{fffe}\x{fffe}\x{fffe}\x{fffe}\x{fffe}\x{fffe}\x{fffe}\x{fffe}\x{fffe}\x{fffe}\x{fffe}\x{fffe}\x{fffe}\x{fffe}\x{fffe}\x{fffe}\x{fffe}\x{fffe}\x{fffe}\x{fffe}\x{fffe}\x{fffe}\x{fffe}\x{fffe}\x{fffe}\x{fffe}\x{fffe}\x{fffe}\x{fffe}\x{fffe}\x{fffe}\x{fffe}\x{fffe}\x{fffe}\x{fffe}\x{fffe}\x{fffe}\x{fffe}\x{fffe}\x{fffe}\x{fffe}\x{fffe}\x{39c}\x{fffe}\x{fffe}\x{fffe}\x{fffe}\x{fffe}\x{fffe}\x{fffe}\x{fffe}\x{fffe}\x{fffe}\x{fffe}\x{fffe}\x{fffe}\x{178}z-\x{101}]

instead of the expected and efficient

[Z\x{39c}\x{178}z-\x{101}]

https://bugzilla.gnome.org/show_bug.cgi?id=678273
glib/pcre/pcre_tables.c