From 55a55895fdb87c717de595d2784536d9ffc1e59a Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Sat, 1 Dec 2007 15:34:41 +0100 Subject: [PATCH] Fix a 4-year-old used-uninitialized bug 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., `^', `$'. --- ChangeLog | 7 +++++++ lib/regcomp.c | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 9ebb98f9e..374322b71 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2007-12-01 Jim Meyering + + 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 * lib/lock.h (gl_recursive_lock_init) [PTHREAD && diff --git a/lib/regcomp.c b/lib/regcomp.c index fe4d243d5..a02418df7 100644 --- a/lib/regcomp.c +++ b/lib/regcomp.c @@ -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: -- 2.11.0