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:
parent
1636ca09ab
commit
417c884a1f
1 changed files with 7 additions and 2 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue