From 2f5d47b1df0248a6fd14b65889e564859cf305c8 Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Sat, 14 Apr 2018 20:37:09 +0200 Subject: [PATCH] Ignore all-whitespace topics in erc * lisp/erc/erc.el (erc-cmd-TOPIC): Ignore all-whitespace topics (bug#25153). --- lisp/erc/erc.el | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el index 63228516be7..f1e21c9a96f 100644 --- a/lisp/erc/erc.el +++ b/lisp/erc/erc.el @@ -3693,8 +3693,10 @@ be displayed." ((string-match "^\\s-*\\([&#+!]\\S-+\\)\\s-\\(.*\\)$" topic) (let ((ch (match-string 1 topic)) (topic (match-string 2 topic))) - (erc-log (format "cmd: TOPIC [%s]: %s" ch topic)) - (erc-server-send (format "TOPIC %s :%s" ch topic) nil ch)) + ;; Ignore all-whitespace topics. + (unless (equal (string-trim topic) "") + (erc-log (format "cmd: TOPIC [%s]: %s" ch topic)) + (erc-server-send (format "TOPIC %s :%s" ch topic) nil ch))) t) ;; /topic #channel ((string-match "^\\s-*\\([&#+!]\\S-+\\)" topic) -- 2.39.5