about summary refs log tree commit diff
path: root/posix/regcomp.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2003-11-13 21:23:11 +0000
committerUlrich Drepper <drepper@redhat.com>2003-11-13 21:23:11 +0000
commita8067e8f899dc2842aba0780a6943bacb8247c8c (patch)
tree10a2eae6158fe4e31fe5dc9ae61b833688436e8e /posix/regcomp.c
parent78c81ab7b4a25563697ce988ecff73c9937cef16 (diff)
downloadglibc-a8067e8f899dc2842aba0780a6943bacb8247c8c.tar.gz
glibc-a8067e8f899dc2842aba0780a6943bacb8247c8c.tar.xz
glibc-a8067e8f899dc2842aba0780a6943bacb8247c8c.zip
Update.
2003-11-13  Jakub Jelinek  <jakub@redhat.com>

	* posix/regcomp.c (optimize_utf8): Optimize even if SIMPLE_BRACKET
	with no bits set for >= 0x80 chars is seen.
	* posix/bug-regex20.c (tests): Add new tests.  Expect [ABC] to be
	optimized.
	(main): Run all tests with RE_ICASE as well.
Diffstat (limited to 'posix/regcomp.c')
-rw-r--r--posix/regcomp.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/posix/regcomp.c b/posix/regcomp.c
index a762859f8c..9f56b389df 100644
--- a/posix/regcomp.c
+++ b/posix/regcomp.c
@@ -964,7 +964,7 @@ static void
 optimize_utf8 (dfa)
      re_dfa_t *dfa;
 {
-  int node;
+  int node, i;
 
   for (node = 0; node < dfa->nodes_len; ++node)
     switch (dfa->nodes[node].type)
@@ -999,6 +999,12 @@ optimize_utf8 (dfa)
       case OP_OPEN_SUBEXP:
       case OP_CLOSE_SUBEXP:
 	break;
+      case SIMPLE_BRACKET:
+	/* Just double check.  */
+        for (i = 0x80 / UINT_BITS; i < BITSET_UINTS; ++i)
+	  if (dfa->nodes[node].opr.sbcset[i])
+	    return;
+	break;
       default:
 	return;
       }