summaryrefslogtreecommitdiff
path: root/posix/regcomp.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2003-11-18 07:25:02 +0000
committerUlrich Drepper <drepper@redhat.com>2003-11-18 07:25:02 +0000
commit5f93cd52f626b77301c5e1db3d973eefc534323b (patch)
tree8bf877d6a8b552be0cd43b88c7540cdbc63397d6 /posix/regcomp.c
parent5ddb5bf5fbceb6f44f04f7267eb214eee5fc2f90 (diff)
downloadglibc-5f93cd52f626b77301c5e1db3d973eefc534323b.tar.gz
Update.
2003-11-17 Jakub Jelinek <jakub@redhat.com> * posix/regcomp.c (optimize_utf8): Optimize multi-byte chars as well. * posix/bug-regex20.c (tests): Add new tests. Multi-byte char followed by dup operator is expected to be optimized. * posix/regexec.c (check_node_accept_bytes): Move nrules and j variables to the block where they are only used, initialize nrules only immediately before using it. 2003-11-15 Andreas Jaeger <aj@suse.de> * sysdeps/x86_64/fpu/s_scalbnl.S: New file. * sysdeps/x86_64/fpu/s_truncl.S: New file. * sysdeps/x86_64/fpu/s_nearbyintl.S: New file. * sysdeps/x86_64/fpu/s_floorl.S: New file. * sysdeps/x86_64/fpu/s_ilogbl.S: New file. * sysdeps/x86_64/fpu/e_remainderl.S: New file. * math/libm-test.inc (floor_test): Test also ±0.25. (ceil_test): Test -0.25.
Diffstat (limited to 'posix/regcomp.c')
-rw-r--r--posix/regcomp.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/posix/regcomp.c b/posix/regcomp.c
index 68ce551c3a..b5f0c92a3a 100644
--- a/posix/regcomp.c
+++ b/posix/regcomp.c
@@ -965,17 +965,14 @@ static void
optimize_utf8 (dfa)
re_dfa_t *dfa;
{
- int node, i;
+ int node, i, mb_chars = 0;
for (node = 0; node < dfa->nodes_len; ++node)
switch (dfa->nodes[node].type)
{
case CHARACTER:
- /* Chars >= 0x80 are optimizable in some cases (e.g. when not
- followed by DUP operator, not in bracket etc.).
- For now punt on them all. */
if (dfa->nodes[node].opr.c >= 0x80)
- return;
+ mb_chars = 1;
break;
case ANCHOR:
switch (dfa->nodes[node].opr.idx)
@@ -1010,6 +1007,12 @@ optimize_utf8 (dfa)
return;
}
+ if (mb_chars)
+ for (node = 0; node < dfa->nodes_len; ++node)
+ if (dfa->nodes[node].type == CHARACTER
+ && dfa->nodes[node].opr.c >= 0x80)
+ dfa->nodes[node].mb_partial = 0;
+
/* The search can be in single byte locale. */
dfa->mb_cur_max = 1;
dfa->is_utf8 = 0;