From c06a6956a40a878fdbe319e4688196e7c990bf7a Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Thu, 18 Nov 2004 23:57:34 +0000 Subject: [BZ #544] Update. 2004-11-18 Jakub Jelinek [BZ #544] * posix/regex.h (RE_NO_SUB): New define. * posix/regex_internal.h (OP_DELETED_SUBEXP): New. (re_dfa_t): Add subexp_map. * posix/regcomp.c (struct subexp_optimize): New type. (optimize_subexps): New routine. (re_compile_internal): Call it. (re_compile_pattern): Set preg->no_sub to 1 if RE_NO_SUB. (free_dfa_content): Free subexp_map. (calc_inveclosure, calc_eclosure): Skip OP_DELETED_SUBEXP nodes. * posix/regexec.c (re_search_internal): If subexp_map is not NULL, duplicate registers as needed. * posix/Makefile: Add rules to build and run tst-regex2. * posix/tst-regex2.c: New test. * posix/rxspencer/tests: Fix last two tests (\0 -> \1). Add some new tests for nested subexpressions. --- posix/regex.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'posix/regex.h') diff --git a/posix/regex.h b/posix/regex.h index 4279dbcc5b..b2d9a62fec 100644 --- a/posix/regex.h +++ b/posix/regex.h @@ -179,6 +179,10 @@ typedef unsigned long int reg_syntax_t; immediately after an alternation or begin-group operator. */ #define RE_CONTEXT_INVALID_DUP (RE_CARET_ANCHORS_HERE << 1) +/* If this bit is set, then no_sub will be set to 1 during + re_compile_pattern. */ +#define RE_NO_SUB (RE_CONTEXT_INVALID_DUP << 1) + /* This global variable defines the particular regexp syntax to use (for some interfaces). When a regexp is compiled, the syntax used is stored in the pattern buffer, so changing this does not affect -- cgit 1.4.1