bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#22099: Path to fix bug in function erc-kill-query-buffers


From: Francis Litterio
Subject: bug#22099: Path to fix bug in function erc-kill-query-buffers
Date: Sun, 6 Dec 2015 01:13:57 +0000 (UTC)
User-agent: Loom/3.14 (http://gmane.org/)

In the latest Emacs sources (Git branch "master"), function
erc-kill-query-buffers fails to protect against being passed nil
for argument PROCESS, which causes all channel buffers on all
servers to be deleted!  This can happen if command /QUIT is issued
in a disconnected server buffer and variable erc-kill-queries-on-quit
is non-nil.

This patch fixes this problem.
--
Fran
flitterio <at> gmail.com


--- erc.el~     2015-08-09 16:04:46.097043200 -0400
+++ erc.el      2015-08-09 16:07:19.082925200 -0400
@@ -6071,13 +6071,14 @@
   (or (file-accessible-directory-p dir) (error "Cannot access %s" dir)))
 
 (defun erc-kill-query-buffers (process)
-  "Kill all buffers of PROCESS."
+  "Kill all buffers of PROCESS.  Does nothing if PROCESS is not a process
object."
   ;; here, we only want to match the channel buffers, to avoid
   ;; "selecting killed buffers" b0rkage.
-  (erc-with-all-buffers-of-server process
-    (lambda ()
-      (not (erc-server-buffer-p)))
-    (kill-buffer (current-buffer))))
+  (if (processp process)
+      (erc-with-all-buffers-of-server process
+        (lambda ()
+          (not (erc-server-buffer-p)))
+        (kill-buffer (current-buffer))))
 
 (defun erc-nick-at-point ()
   "Give information about the nickname at `point'.







reply via email to

[Prev in Thread] Current Thread [Next in Thread]