From 0a0ec8958a3026d04101a0501d117a0195df8097 Mon Sep 17 00:00:00 2001 From: "F. Jason Park" Date: Fri, 1 Jul 2022 05:47:31 -0700 Subject: [PATCH] ; Fix regexp in ERC test-server utility * test/lisp/erc/resources/erc-d/erc-d-i.el (erc-d-i--tag-unescaped-regexp): Thanks to Mattias and relint for catching this. --- test/lisp/erc/resources/erc-d/erc-d-i.el | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/test/lisp/erc/resources/erc-d/erc-d-i.el b/test/lisp/erc/resources/erc-d/erc-d-i.el index 27b1bf60839..db113335a82 100644 --- a/test/lisp/erc/resources/erc-d/erc-d-i.el +++ b/test/lisp/erc/resources/erc-d/erc-d-i.el @@ -39,14 +39,14 @@ UTF-8 text before parsing, which is nonstandard." (defconst erc-d-i--tag-escapes '((";" . "\\:") (" " . "\\s") ("\\" . "\\\\") ("\r" . "\\r") ("\n" . "\\n"))) -;; XXX these are not mirror inverses; unescaping may degenerate -;; original by dropping stranded/misplaced backslashes. +;; These are not mirror inverses; unescaping may drop stranded or +;; misplaced backslashes. (defconst erc-d-i--tag-escaped-regexp (rx (or ?\; ?\ ?\\ ?\r ?\n))) (defconst erc-d-i--tag-unescaped-regexp (rx (or "\\:" "\\s" "\\\\" "\\r" "\\n" - (seq "\\" (or string-end (not (or ":" "n" "r" "\\"))))))) + (seq "\\" (or string-end (not (or ":" "s" "n" "r" "\\"))))))) (defun erc-d-i--unescape-tag-value (str) "Undo substitution of char placeholders in raw tag value STR." @@ -65,8 +65,6 @@ UTF-8 text before parsing, which is nonstandard." (defconst erc-d-i--invalid-tag-regexp (rx (any "\0\7\r\n; "))) -;; This is `erc-v3-message-tags' with fatal errors. - (defun erc-d-i--validate-tags (raw) "Validate tags portion of some RAW incoming message. RAW must not have a leading \"@\" or a trailing space. The spec says -- 2.39.2