changeset 69266:a080fc579e98

(rx-check-any, rx-check-not): Quote "]"s in regexps when they have no special meaning.
author Eli Zaretskii <eliz@gnu.org>
date Fri, 03 Mar 2006 12:19:21 +0000
parents 268da31ddfc5
children c3f3f618663b
files lisp/emacs-lisp/rx.el
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/emacs-lisp/rx.el	Fri Mar 03 12:18:47 2006 +0000
+++ b/lisp/emacs-lisp/rx.el	Fri Mar 03 12:19:21 2006 +0000
@@ -372,8 +372,8 @@
      (if (eq ?^ (aref arg 0))
 	 (setq arg (concat "\\" arg)))
      ;; Remove ] and set flag for adding it to start of overall result.
-     (when (string-match "]" arg)
-       (setq arg (replace-regexp-in-string "]" "" arg)
+     (when (string-match "\\]" arg)
+       (setq arg (replace-regexp-in-string "\\]" "" arg)
 	     rx-bracket "]")))
    (when (symbolp arg)
      (let ((translation (condition-case nil
@@ -405,7 +405,7 @@
 (defun rx-check-not (arg)
   "Check arg ARG for Rx `not'."
   (unless (or (and (symbolp arg)
-		   (string-match "\\`\\[\\[:[-a-z]:]]\\'"
+		   (string-match "\\`\\[\\[:[-a-z]:\\]\\]\\'"
 				 (condition-case nil
 				     (rx-to-string arg 'no-group)
 				   (error ""))))