Subject: Re: bug#62444: [PATCH] erc: Fix "dcc get" flag parsing

From: "J.P." <[email-masked]>
Date: Fri, 07 Jul 2023 21:24:38 -0700

Hi Fernando,

Fernando de Morais <[email-masked]> writes:

> I can no longer receive files from senders whose
> nicknames contains a "|" pipe character.
>
> Example:
>
> 	/DCC GET EXAMPLE|Nick file_name.txt
>
> ERC returns in its buffer (followed by an *Apropos* buffer showing up in
> another window):
>
> 	*** DCC: Nick undefined subcommand. GET, CHAT and LIST are defined.

Thanks for the heads up. This looks like my bad. Would something like
the attached (untried) maybe suffice as a temporary workaround?

diff --git a/lisp/erc/erc-compat.el b/lisp/erc/erc-compat.el
index 29892b78a39..6f091668087 100644
--- a/lisp/erc/erc-compat.el
+++ b/lisp/erc/erc-compat.el
@@ -461,10 +461,14 @@ erc-compat--28-split-string-shell-command
 
 (defmacro erc-compat--split-string-shell-command (string)
   ;; Autoloaded in Emacs 28.
-  (list (if (fboundp 'split-string-shell-command)
-            'split-string-shell-command
-          'erc-compat--28-split-string-shell-command)
-        string))
+  `(progn
+     (advice-add 'shell-backward-command :override #'goto-char)
+     (unwind-protect
+         ,(list (if (fboundp 'split-string-shell-command)
+                    'split-string-shell-command
+                  'erc-compat--28-split-string-shell-command)
+                string)
+       (advice-remove 'shell-backward-command #'goto-char))))
 
 (provide 'erc-compat)