# HG changeset patch # User Gerd Moellmann # Date 991303113 0 # Node ID d95290112d89e65d818aea0872bdcb7138333a1a # Parent 7103eb9ef882cf4f4d3199925dde634268e94401 (Fdo_auto_save): Don't try to create the directory of auto-save-list-file-name when shutting down Emacs, because creating the directory might signal an error, and leaves Emacs in a strange state. diff -r 7103eb9ef882 -r d95290112d89 src/fileio.c --- a/src/fileio.c Thu May 31 08:56:58 2001 +0000 +++ b/src/fileio.c Thu May 31 09:58:33 2001 +0000 @@ -5370,13 +5370,20 @@ if (STRINGP (Vauto_save_list_file_name)) { - Lisp_Object listfile, dir; + Lisp_Object listfile; listfile = Fexpand_file_name (Vauto_save_list_file_name, Qnil); - - dir = Ffile_name_directory (listfile); - if (NILP (Ffile_directory_p (dir))) - call2 (Qmake_directory, dir, Qt); + + /* Don't try to create the directory when shutting down Emacs, + because creating the directory might signal an error, and + that would leave Emacs in a strange state. */ + if (!NILP (Vrun_hooks)) + { + Lisp_Object dir; + dir = Ffile_name_directory (listfile); + if (NILP (Ffile_directory_p (dir))) + call2 (Qmake_directory, dir, Qt); + } stream = fopen (XSTRING (listfile)->data, "w"); if (stream != NULL)