From 0eff1f85acea7e81934ed8f34b4e382f4d66aade Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Sun, 17 Aug 1997 23:20:07 +0000 Subject: [PATCH] (Fdo_auto_save): If open fails, make lispstream nil. --- src/fileio.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/fileio.c b/src/fileio.c index 303f9e143cd..d82cc274199 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -4536,12 +4536,16 @@ A non-nil CURRENT-ONLY argument means save only current buffer.") Lisp_Object listfile; listfile = Fexpand_file_name (Vauto_save_list_file_name, Qnil); stream = fopen (XSTRING (listfile)->data, "w"); - - /* Arrange to close that file whether or not we get an error. - Also reset auto_saving to 0. */ - lispstream = Fcons (Qnil, Qnil); - XSETFASTINT (XCONS (lispstream)->car, (EMACS_UINT)stream >> 16); - XSETFASTINT (XCONS (lispstream)->cdr, (EMACS_UINT)stream & 0xffff); + if (stream != NULL) + { + /* Arrange to close that file whether or not we get an error. + Also reset auto_saving to 0. */ + lispstream = Fcons (Qnil, Qnil); + XSETFASTINT (XCONS (lispstream)->car, (EMACS_UINT)stream >> 16); + XSETFASTINT (XCONS (lispstream)->cdr, (EMACS_UINT)stream & 0xffff); + } + else + lispstream = Qnil; } else { -- 2.39.5