diff options
author | Ulrich Drepper <drepper@redhat.com> | 2003-11-13 06:01:46 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 2003-11-13 06:01:46 +0000 |
commit | 06e8303a288f626929d69e57eb4128b2e40b1313 (patch) | |
tree | 992c00ec8ac45cd0d97a5778bb1b947799588469 /posix/regex.h | |
parent | 813ec65a4d69dcf9b2ecaf42395a4ba62dd2d33c (diff) | |
download | glibc-06e8303a288f626929d69e57eb4128b2e40b1313.tar glibc-06e8303a288f626929d69e57eb4128b2e40b1313.tar.gz glibc-06e8303a288f626929d69e57eb4128b2e40b1313.tar.bz2 glibc-06e8303a288f626929d69e57eb4128b2e40b1313.zip |
Update.
* posix/regcomp.c (parse_expression): If token is OP_OPEN_DUP_NUM
and RE_CONTEXT_INVALID_DUP syntax flag is set, fail.
* posix/regex.h (RE_CONTEXT_INVALUD_OPS): New macro.
(RE_SYNTAX_POSIX_BASIC): Use RE_CONTEXT_INVALUD_OPS.
* posix/regcomp.c (parse_sub_exp): In case of not-matching ( )
return REG_EPAREN.
Diffstat (limited to 'posix/regex.h')
-rw-r--r-- | posix/regex.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/posix/regex.h b/posix/regex.h index 1ab3e243a7..c76005332d 100644 --- a/posix/regex.h +++ b/posix/regex.h @@ -175,6 +175,10 @@ typedef unsigned long int reg_syntax_t; whether ^ should be special. */ #define RE_CARET_ANCHORS_HERE (RE_ICASE << 1) +/* If this bit is set, then \{ cannot be first in an bre or + immediately after an alternation or begin-group operator. */ +#define RE_CONTEXT_INVALID_DUP (RE_CARET_ANCHORS_HERE << 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 @@ -229,7 +233,7 @@ extern reg_syntax_t re_syntax_options; | RE_INTERVALS | RE_NO_EMPTY_RANGES) #define RE_SYNTAX_POSIX_BASIC \ - (_RE_SYNTAX_POSIX_COMMON | RE_BK_PLUS_QM) + (_RE_SYNTAX_POSIX_COMMON | RE_BK_PLUS_QM | RE_CONTEXT_INVALID_DUP) /* Differs from ..._POSIX_BASIC only in that RE_BK_PLUS_QM becomes RE_LIMITED_OPS, i.e., \? \+ \| are not recognized. Actually, this |