Commit f721084f authored by Victor J. Orlikowski's avatar Victor J. Orlikowski Committed by Eli Zaretskii

Avoid errors in erc-dcc.el when erc-dcc-verbose is non-nil

* lisp/erc/erc-dcc.el (erc-dcc-get-filter): Don't assume STR
is always a string.  Use 'buffer-name' to get the DCC file
name, as buffer-file-name is not set in the process buffer.

Copyright-paperwork-exempt: yes
parent 3cba92d4
Pipeline #771 passed with stage
in 34 minutes and 51 seconds
......@@ -989,17 +989,20 @@ rather than every 1024 byte block, but nobody seems to care."
(let ((inhibit-read-only t)
received-bytes)
(goto-char (point-max))
(insert (string-make-unibyte str))
(if str
(insert (string-make-unibyte str)))
(when (> (point-max) erc-dcc-receive-cache)
(erc-dcc-append-contents (current-buffer) erc-dcc-file-name))
(setq received-bytes (+ (buffer-size) erc-dcc-byte-count))
(setq received-bytes (buffer-size))
(if erc-dcc-byte-count
(setq received-bytes (+ received-bytes erc-dcc-byte-count)))
(and erc-dcc-verbose
(erc-display-message
nil 'notice erc-server-process
'dcc-get-bytes-received
?f (file-name-nondirectory buffer-file-name)
?f (file-name-nondirectory (buffer-name))
?b (number-to-string received-bytes)))
(cond
((and (> (plist-get erc-dcc-entry-data :size) 0)
......@@ -1007,7 +1010,7 @@ rather than every 1024 byte block, but nobody seems to care."
(erc-display-message
nil '(notice error) 'active
'dcc-get-file-too-long
?f (file-name-nondirectory buffer-file-name))
?f (file-name-nondirectory (buffer-name)))
(delete-process proc))
(t
(process-send-string
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment