Mercurial > hg > xemacs-beta
comparison src/editfns.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 | 80cd90837ac5 |
children | d261888e5069 |
comparison
equal
deleted
inserted
replaced
4732:2491a837112c | 4733:a5210e70ffbe |
---|---|
860 qxesprintf (cached_home_directory, "%s%s", | 860 qxesprintf (cached_home_directory, "%s%s", |
861 homedrive, | 861 homedrive, |
862 homepath); | 862 homepath); |
863 } | 863 } |
864 else | 864 else |
865 #endif /* !WIN32_NATIVE */ | |
865 { | 866 { |
866 cached_home_directory = qxestrdup ((Ibyte *) "C:\\"); | 867 /* Unix, typically. |
868 Using "/" isn't quite right, but what should we do? | |
869 We probably should try to extract pw_dir from /etc/passwd, | |
870 before falling back to this. */ | |
871 cached_home_directory = qxestrdup (DEFAULT_DIRECTORY_FALLBACK); | |
867 output_home_warning = 1; | 872 output_home_warning = 1; |
868 } | 873 } |
869 #else /* !WIN32_NATIVE */ | |
870 /* | |
871 * Unix, typically. | |
872 * Using "/" isn't quite right, but what should we do? | |
873 * We probably should try to extract pw_dir from /etc/passwd, | |
874 * before falling back to this. | |
875 */ | |
876 cached_home_directory = qxestrdup ((Ibyte *) "/"); | |
877 output_home_warning = 1; | |
878 #endif /* !WIN32_NATIVE */ | |
879 } | 874 } |
880 if (initialized && output_home_warning) | 875 if (initialized && output_home_warning) |
881 { | 876 { |
882 warn_when_safe (Quser_files_and_directories, Qwarning, "\n" | 877 warn_when_safe (Quser_files_and_directories, Qwarning, "\n" |
883 " XEmacs was unable to determine a good value for the user's $HOME\n" | 878 " XEmacs was unable to determine a good value for the user's $HOME\n" |