diff options
author | F. Jason Park <jp@neverwas.me> | 2021-06-13 02:15:55 -0700 |
---|---|---|
committer | Lars Ingebrigtsen <larsi@gnus.org> | 2021-11-06 19:13:35 +0100 |
commit | 1b1d387b96ebeb8330a76240db0cda6b8cefdf1f (patch) | |
tree | b4c94c283b90f139bbb5c1f822dca0a4230a232c /lisp/erc | |
parent | dedab1c30da26d3741928cdad5e9fcf3075a2726 (diff) | |
download | emacs-1b1d387b96ebeb8330a76240db0cda6b8cefdf1f.tar.gz emacs-1b1d387b96ebeb8330a76240db0cda6b8cefdf1f.tar.bz2 emacs-1b1d387b96ebeb8330a76240db0cda6b8cefdf1f.zip |
Don't send empty lines for unknown commands in ERC
* lisp/erc/erc.el (erc-cmd-default): prevent excess trailing newlines
from being sent.
* test/lisp/erc/erc-tests.el: Update `erc-process-input-line' test to
check for excess line feeds with unknown commands.
Diffstat (limited to 'lisp/erc')
-rw-r--r-- | lisp/erc/erc.el | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el index 9fa17365356..8e2bb833605 100644 --- a/lisp/erc/erc.el +++ b/lisp/erc/erc.el @@ -2965,7 +2965,7 @@ Commands for which no erc-cmd-xxx exists, are tunneled through this function. LINE is sent to the server verbatim, and therefore has to contain the command itself as well." (erc-log (format "cmd: DEFAULT: %s" line)) - (erc-server-send (substring line 1)) + (erc-server-send (string-trim-right (substring line 1) "[\r\n]")) t) (defvar erc--read-time-period-history nil) |