Fix rx-any with range with ?\] and ?-

* lisp/emacs-lisp/rx.el: Make sure not to produce a circular
list (Bug#25123).
* test/lisp/emacs-lisp/rx-tests.el (rx-char-any): New test.
This commit is contained in:
Noam Postavsky 2016-12-07 23:17:37 -05:00
parent b21a3e726f
commit a7523ba955
2 changed files with 38 additions and 1 deletions

View file

@ -521,7 +521,7 @@ ARG is optional."
(setq args (nconc (delq ?- args) (list ?-))))
((setq m (assq ?- args))
;; next to the bracket's range, make the second range
(setcdr args (cons m (delq m args))))))
(setcdr args (cons m (delq m (cdr args)))))))
;; bracket in the end range
;; => "[]...-]"
((setq m (rassq ?\] args))