comparison src/fileio.c @ 4733:a5210e70ffbe

No need to fatal () on startup if $PWD doesn't exist; chdir to "/" instead. src/ChangeLog addition: 2009-11-08 Aidan Kehoe <kehoea@parhasard.net> * sysfile.h (DEFAULT_DIRECTORY_FALLBACK): New #define, "/" on Unix and "C:\\" on Win32 native, a directory that should "always" be available. * fileio.c (Fexpand_file_name): Use DEFAULT_DIRECTORY_FALLBACK here, instead of conditionalising on WIN32_NATIVE. * editfns.c (get_home_directory): Use DEFAULT_DIRECTORY_FALLBACK if looking up the home directory fails, on both Windows and Unix. * buffer.c (init_initial_directory): Don't give a fatal error if the current directory doesn't exist, chdir to DEFAULT_DIRECTORY_FALLBACK instead.
author Aidan Kehoe <kehoea@parhasard.net>
date Sun, 08 Nov 2009 17:27:26 +0000
parents eb82259f265d
children aa5ed11f473b
comparison
equal deleted inserted replaced
4732:2491a837112c 4733:a5210e70ffbe
788 788
789 /* Use the buffer's default-directory if DEFAULT_DIRECTORY is omitted. */ 789 /* Use the buffer's default-directory if DEFAULT_DIRECTORY is omitted. */
790 if (NILP (default_directory)) 790 if (NILP (default_directory))
791 default_directory = current_buffer->directory; 791 default_directory = current_buffer->directory;
792 if (! STRINGP (default_directory)) 792 if (! STRINGP (default_directory))
793 #ifdef WIN32_NATIVE 793 default_directory = build_string (DEFAULT_DIRECTORY_FALLBACK);
794 default_directory = build_string ("C:\\");
795 #else
796 default_directory = build_string ("/");
797 #endif
798 794
799 if (!NILP (default_directory)) 795 if (!NILP (default_directory))
800 { 796 {
801 handler = Ffind_file_name_handler (default_directory, Qexpand_file_name); 797 handler = Ffind_file_name_handler (default_directory, Qexpand_file_name);
802 if (!NILP (handler)) 798 if (!NILP (handler))