diff options
| author | Mattias EngdegÄrd | 2020-02-27 18:29:56 +0100 |
|---|---|---|
| committer | Mattias EngdegÄrd | 2020-02-27 18:58:05 +0100 |
| commit | ef4440a9c80b284d46ecce47f4d387f132bbf374 (patch) | |
| tree | 8290c26eb740f754e601bbd955626f45b5dd221e /src | |
| parent | 4859e8db9b518034418f536c5bab3f30cb4714e3 (diff) | |
| download | emacs-ef4440a9c80b284d46ecce47f4d387f132bbf374.tar.gz emacs-ef4440a9c80b284d46ecce47f4d387f132bbf374.zip | |
Revert "Signal an error for the regexp "[:alnum:]""
This reverts commit 8d5e8cddab732ac90e9ae930c63f7830f9dab24f.
Diffstat (limited to 'src')
| -rw-r--r-- | src/regex-emacs.c | 21 |
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 | |||
| 818 | REG_ESIZE, /* Compiled pattern bigger than 2^16 bytes. */ | 818 | REG_ESIZE, /* Compiled pattern bigger than 2^16 bytes. */ |
| 819 | REG_ERPAREN, /* Unmatched ) or \); not returned from regcomp. */ | 819 | REG_ERPAREN, /* Unmatched ) or \); not returned from regcomp. */ |
| 820 | REG_ERANGEX, /* Range striding over charsets. */ | 820 | REG_ERANGEX, /* Range striding over charsets. */ |
| 821 | REG_ESIZEBR, /* n or m too big in \{n,m\} */ | 821 | REG_ESIZEBR /* n or m too big in \{n,m\} */ |
| 822 | REG_ECLASSBR, /* Missing [] around [:class:]. */ | ||
| 823 | } reg_errcode_t; | 822 | } reg_errcode_t; |
| 824 | 823 | ||
| 825 | static const char *re_error_msgid[] = | 824 | static const char *re_error_msgid[] = |
| @@ -843,7 +842,6 @@ static const char *re_error_msgid[] = | |||
| 843 | [REG_ERPAREN] = "Unmatched ) or \\)", | 842 | [REG_ERPAREN] = "Unmatched ) or \\)", |
| 844 | [REG_ERANGEX ] = "Range striding over charsets", | 843 | [REG_ERANGEX ] = "Range striding over charsets", |
| 845 | [REG_ESIZEBR ] = "Invalid content of \\{\\}", | 844 | [REG_ESIZEBR ] = "Invalid content of \\{\\}", |
| 846 | [REG_ECLASSBR] = "Class syntax is [[:digit:]]; missing brackets", | ||
| 847 | }; | 845 | }; |
| 848 | 846 | ||
| 849 | /* For 'regs_allocated'. */ | 847 | /* For 'regs_allocated'. */ |
| @@ -2002,23 +2000,6 @@ regex_compile (re_char *pattern, ptrdiff_t size, | |||
| 2002 | 2000 | ||
| 2003 | laststart = b; | 2001 | laststart = b; |
| 2004 | 2002 | ||
| 2005 | /* Check for the mistake of forgetting the extra square brackets, | ||
| 2006 | as in "[:alpha:]". */ | ||
| 2007 | if (*p == ':') | ||
| 2008 | { | ||
| 2009 | re_char *q = p + 1; | ||
| 2010 | while (q != pend && *q != ']') | ||
| 2011 | { | ||
| 2012 | if (*q == ':') | ||
| 2013 | { | ||
| 2014 | if (q + 1 != pend && q[1] == ']' && q > p + 1) | ||
| 2015 | FREE_STACK_RETURN (REG_ECLASSBR); | ||
| 2016 | break; | ||
| 2017 | } | ||
| 2018 | q++; | ||
| 2019 | } | ||
| 2020 | } | ||
| 2021 | |||
| 2022 | /* Test '*p == '^' twice, instead of using an if | 2003 | /* Test '*p == '^' twice, instead of using an if |
| 2023 | statement, so we need only one BUF_PUSH. */ | 2004 | statement, so we need only one BUF_PUSH. */ |
| 2024 | BUF_PUSH (*p == '^' ? charset_not : charset); | 2005 | BUF_PUSH (*p == '^' ? charset_not : charset); |