summaryrefslogtreecommitdiff
path: root/lisp/erc/erc-dcc.el
diff options
context:
space:
mode:
authorAmin Bandali <bandali@gnu.org>2021-09-12 14:12:50 -0400
committerAmin Bandali <bandali@gnu.org>2021-09-12 14:32:13 -0400
commit85d0ed097efc97b8a8056150328fba998c131df9 (patch)
tree72b337af34873d202e11dbbd6d07e4d9b324c4a9 /lisp/erc/erc-dcc.el
parente20bae005e9fff0f7f9cdb54a8d797c65e01e7ee (diff)
downloademacs-85d0ed097efc97b8a8056150328fba998c131df9.tar.gz
ERC: Use 'string-replace' only on Emacs 28 and later
* lisp/erc/erc-dcc.el (erc-dcc-unquote-filename): * lisp/erc/erc.el (erc-quit-reason-zippy, erc-part-reason-zippy) (erc-update-mode-line-buffer, erc-message-english-PART): Use 'string-replace' only on Emacs 28 and later, otherwise use 'replace-regexp-in-string' on older Emacsen.
Diffstat (limited to 'lisp/erc/erc-dcc.el')
-rw-r--r--lisp/erc/erc-dcc.el9
1 files changed, 7 insertions, 2 deletions
diff --git a/lisp/erc/erc-dcc.el b/lisp/erc/erc-dcc.el
index df53270831d..b80f1832d7c 100644
--- a/lisp/erc/erc-dcc.el
+++ b/lisp/erc/erc-dcc.el
@@ -632,8 +632,13 @@ that subcommand."
(define-inline erc-dcc-unquote-filename (filename)
(inline-quote
- (string-replace "\\\\" "\\"
- (string-replace "\\\"" "\"" ,filename))))
+ (if (>= emacs-major-version 28)
+ (string-replace
+ "\\\\" "\\"
+ (string-replace "\\\"" "\"" ,filename))
+ (replace-regexp-in-string
+ "\\\\\\\\" "\\"
+ (replace-regexp-in-string "\\\\\"" "\"" ,filename t t) t t))))
(defun erc-dcc-handle-ctcp-send (proc query nick login host to)
"This is called if a CTCP DCC SEND subcommand is sent to the client.