From: Richard M. Stallman Date: Sun, 17 Aug 1997 23:20:07 +0000 (+0000) Subject: (Fdo_auto_save): If open fails, make lispstream nil. X-Git-Tag: emacs-20.1~547 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=0eff1f85acea7e81934ed8f34b4e382f4d66aade;p=emacs.git (Fdo_auto_save): If open fails, make lispstream nil. --- 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 {