1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-25 15:00:45 -08:00

(Fread_file_name) [DOS_NT]: Don't crash if homedir is NULL.

This commit is contained in:
Eli Zaretskii 2000-12-02 11:16:13 +00:00
parent 1636ca09ab
commit 417c884a1f

View file

@ -5627,8 +5627,13 @@ provides a file dialog box..")
/* If dir starts with user's homedir, change that to ~. */
homedir = (char *) egetenv ("HOME");
#ifdef DOS_NT
homedir = strcpy (alloca (strlen (homedir) + 1), homedir);
CORRECT_DIR_SEPS (homedir);
/* homedir can be NULL in temacs, since Vprocess_environment is not
yet set up. We shouldn't crash in that case. */
if (homedir != 0)
{
homedir = strcpy (alloca (strlen (homedir) + 1), homedir);
CORRECT_DIR_SEPS (homedir);
}
#endif
if (homedir != 0
&& STRINGP (dir)