summaryrefslogtreecommitdiff
path: root/etc
diff options
context:
space:
mode:
authorMattias EngdegÄrd <mattiase@acm.org>2019-03-12 14:39:47 +0100
committerMattias EngdegÄrd <mattiase@acm.org>2019-03-19 20:30:15 +0100
commit3ed1621d843e057ad879fbed3605d32f55a065b9 (patch)
treee4bd97bb649e9b6c05a0601eba5ef754f0d3310c /etc
parentc0936672876bccc15e7899e83d8ab99910f8feee (diff)
downloademacs-3ed1621d843e057ad879fbed3605d32f55a065b9.tar.gz
Disallow reversed char ranges in `rx'
(any "a-Z0-9") generated "[0-9]", and (any (?9 . ?0)) generated "[9-0]". Reversed ranges are either mistakes or abuse. Neither should be allowed. etc/NEWS: Explain the change. lisp/emacs-lisp/rx.el (rx): Document. (rx-check-any-string, rx-check-any): Add error checks for reversed ranges. test/lisp/emacs-lisp/rx-tests.el (rx-char-any-range-bad): New test.
Diffstat (limited to 'etc')
-rw-r--r--etc/NEWS7
1 files changed, 7 insertions, 0 deletions
diff --git a/etc/NEWS b/etc/NEWS
index f25c3f5dc3d..f955308ebe5 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -1336,6 +1336,13 @@ they are now allocated like any other pseudovector. As a result, the
'misc' component, and the 'misc-objects-consed' variable has been
removed.
++++
+** Reversed character ranges are no longer permitted in rx.
+Previously, ranges where the starting character is greater than the
+ending character were silently omitted.
+For example, '(rx (any "@z-a" (?9 . ?0)))' would match '@' only.
+Now, such rx expressions generate an error.
+
* Lisp Changes in Emacs 27.1