summaryrefslogtreecommitdiff
path: root/src/regex-emacs.c
diff options
context:
space:
mode:
authorMattias EngdegÄrd <mattiase@acm.org>2020-02-27 18:29:56 +0100
committerMattias EngdegÄrd <mattiase@acm.org>2020-02-27 18:58:05 +0100
commitef4440a9c80b284d46ecce47f4d387f132bbf374 (patch)
tree8290c26eb740f754e601bbd955626f45b5dd221e /src/regex-emacs.c
parent4859e8db9b518034418f536c5bab3f30cb4714e3 (diff)
downloademacs-ef4440a9c80b284d46ecce47f4d387f132bbf374.tar.gz
Revert "Signal an error for the regexp "[:alnum:]""
This reverts commit 8d5e8cddab732ac90e9ae930c63f7830f9dab24f.
Diffstat (limited to 'src/regex-emacs.c')
-rw-r--r--src/regex-emacs.c21
1 files changed, 1 insertions, 20 deletions
diff --git a/src/regex-emacs.c b/src/regex-emacs.c
index 38824370e05..694431c95e2 100644
--- a/src/regex-emacs.c
+++ b/src/regex-emacs.c
@@ -818,8 +818,7 @@ typedef enum
REG_ESIZE, /* Compiled pattern bigger than 2^16 bytes. */
REG_ERPAREN, /* Unmatched ) or \); not returned from regcomp. */
REG_ERANGEX, /* Range striding over charsets. */
- REG_ESIZEBR, /* n or m too big in \{n,m\} */
- REG_ECLASSBR, /* Missing [] around [:class:]. */
+ REG_ESIZEBR /* n or m too big in \{n,m\} */
} reg_errcode_t;
static const char *re_error_msgid[] =
@@ -843,7 +842,6 @@ static const char *re_error_msgid[] =
[REG_ERPAREN] = "Unmatched ) or \\)",
[REG_ERANGEX ] = "Range striding over charsets",
[REG_ESIZEBR ] = "Invalid content of \\{\\}",
- [REG_ECLASSBR] = "Class syntax is [[:digit:]]; missing brackets",
};
/* For 'regs_allocated'. */
@@ -2002,23 +2000,6 @@ regex_compile (re_char *pattern, ptrdiff_t size,
laststart = b;
- /* Check for the mistake of forgetting the extra square brackets,
- as in "[:alpha:]". */
- if (*p == ':')
- {
- re_char *q = p + 1;
- while (q != pend && *q != ']')
- {
- if (*q == ':')
- {
- if (q + 1 != pend && q[1] == ']' && q > p + 1)
- FREE_STACK_RETURN (REG_ECLASSBR);
- break;
- }
- q++;
- }
- }
-
/* Test '*p == '^' twice, instead of using an if
statement, so we need only one BUF_PUSH. */
BUF_PUSH (*p == '^' ? charset_not : charset);