From d674d13e14107bdc860391e08b724310f752235e Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Sun, 28 Dec 2003 22:16:57 +0000 Subject: [PATCH] (Fother_buffer): Don't crash if BUF is nil or if its name is nil. (Fkill_buffer): Don't delete auto-save file if it's the same as the visited file. --- src/buffer.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/buffer.c b/src/buffer.c index e41d114eaa3..533e2c9c506 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -89,10 +89,6 @@ static Lisp_Object Vbuffer_defaults; If a slot is -2, then there is no DEFVAR_PER_BUFFER for it, but there is a default value which is copied into each buffer. - If a slot in this structure is negative, then even though there may - be a DEFVAR_PER_BUFFER for the slot, there is no default value for it; - and the corresponding slot in buffer_defaults is not used. - If a slot in this structure corresponding to a DEFVAR_PER_BUFFER is zero, that is a bug */ @@ -1202,6 +1198,10 @@ If BUFFER is omitted or nil, some interesting buffer is returned. */) buf = Fcdr (XCAR (tail)); if (EQ (buf, buffer)) continue; + if (NILP (buf)) + continue; + if (NILP (XBUFFER (buf)->name)) + continue; if (SREF (XBUFFER (buf)->name, 0) == ' ') continue; /* If the selected frame has a buffer_predicate, @@ -1429,7 +1429,8 @@ with SIGHUP. */) if (STRINGP (b->auto_save_file_name) && b->auto_save_modified != 0 && BUF_SAVE_MODIFF (b) < b->auto_save_modified - && BUF_SAVE_MODIFF (b) < BUF_MODIFF (b)) + && BUF_SAVE_MODIFF (b) < BUF_MODIFF (b) + && NILP (Fsymbol_value (intern ("auto-save-visited-file-name")))) { Lisp_Object tem; tem = Fsymbol_value (intern ("delete-auto-save-files")); -- 2.39.2