diff options
author | Rich Felker <dalias@aerifal.cx> | 2015-03-20 18:25:01 -0400 |
---|---|---|
committer | Rich Felker <dalias@aerifal.cx> | 2015-03-20 18:28:37 -0400 |
commit | 7c8c86f6308c7e0816b9638465a5917b12159e8f (patch) | |
tree | 1ed8044a0a76be0bd66ecf93e055e524c1ba0fd8 /src/regex | |
parent | 39dfd58417ef642307d90306e1c7e50aaec5a35c (diff) | |
download | musl-7c8c86f6308c7e0816b9638465a5917b12159e8f.zip musl-7c8c86f6308c7e0816b9638465a5917b12159e8f.tar.gz musl-7c8c86f6308c7e0816b9638465a5917b12159e8f.tar.bz2 |
suppress backref processing in ERE regcomp
one of the features of ERE is that it's actually a regular language
and does not admit expressions which cannot be matched in linear time.
introduction of \n backref support into regcomp's ERE parsing was
unintentional.
Diffstat (limited to 'src/regex')
-rw-r--r-- | src/regex/regcomp.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/regex/regcomp.c b/src/regex/regcomp.c index bce6bc1..4d80cb1 100644 --- a/src/regex/regcomp.c +++ b/src/regex/regcomp.c @@ -839,7 +839,7 @@ static reg_errcode_t parse_atom(tre_parse_ctx_t *ctx, const char *s) s--; break; default: - if (isdigit(*s)) { + if (!ere && isdigit(*s)) { /* back reference */ int val = *s - '0'; node = tre_ast_new_literal(ctx->mem, BACKREF, val, ctx->position); |