Fix a 4-year-old used-uninitialized bug in regcomp.c.
authorJim Meyering <meyering@redhat.com>
Sat, 1 Dec 2007 14:34:41 +0000 (15:34 +0100)
committerJim Meyering <meyering@redhat.com>
Sat, 1 Dec 2007 14:38:26 +0000 (15:38 +0100)
* lib/regcomp.c (optimize_utf8): Fix a typo, s/idx/ctx_type/,
that would inhibit utf8-optimization of a regexp containing line-
or buffer-anchors, e.g., `^', `$'.

ChangeLog
lib/regcomp.c

index 9ebb98f..374322b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2007-12-01  Jim Meyering  <meyering@redhat.com>
+
+       Fix a bug that inhibited much of the utf8-optimization in regcomp.c.
+       * lib/regcomp.c (optimize_utf8): Fix a typo, s/idx/ctx_type/,
+       that would inhibit utf8-optimization of a regexp containing line-
+       or buffer-anchors, e.g., `^', `$'.
+
 2007-11-30  Bruno Haible  <bruno@clisp.org>
 
        * lib/lock.h (gl_recursive_lock_init) [PTHREAD &&
index fe4d243..a02418d 100644 (file)
@@ -1049,7 +1049,7 @@ optimize_utf8 (re_dfa_t *dfa)
          mb_chars = true;
        break;
       case ANCHOR:
-       switch (dfa->nodes[node].opr.idx)
+       switch (dfa->nodes[node].opr.ctx_type)
          {
          case LINE_FIRST:
          case LINE_LAST: