Commit 3766bf72 authored by Mattias Engdegård's avatar Mattias Engdegård

Don't complain about the regexp "[:-:]"

Suggested by Clément Pit-Claudel.

* src/regex-emacs.c (regex_compile):
* test/src/regex-emacs-tests.el (regexp-invalid): Tolerate ranges.
parent 8d5e8cdd
Pipeline #4880 passed with stage
in 52 minutes and 36 seconds
......@@ -2007,7 +2007,7 @@ regex_compile (re_char *pattern, ptrdiff_t size,
if (*p == ':')
{
re_char *q = p + 1;
while (q != pend && *q != ']')
while (q != pend && *q != ']' && *q != '-')
{
if (*q == ':')
{
......
......@@ -806,6 +806,7 @@ This evaluates the TESTS test cases from glibc."
(ert-deftest regexp-invalid ()
;; relint suppression: Duplicated
(should-error (string-match "[:space:]" "")
:type 'invalid-regexp))
:type 'invalid-regexp)
(should (equal (string-match "[:-:]" "a-:") 2)))
;;; regex-emacs-tests.el ends here
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment