aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEli Zaretskii2000-12-02 11:16:13 +0000
committerEli Zaretskii2000-12-02 11:16:13 +0000
commit417c884a1f07affbcd0bffe693ce354d032a337c (patch)
treec6459f83dc30ba390bc8889427d5302e49d4f4d0 /src
parent1636ca09ab7db26b28351f9d1643f07c407691fd (diff)
downloademacs-417c884a1f07affbcd0bffe693ce354d032a337c.tar.gz
emacs-417c884a1f07affbcd0bffe693ce354d032a337c.zip
(Fread_file_name) [DOS_NT]: Don't crash if homedir is NULL.
Diffstat (limited to 'src')
-rw-r--r--src/fileio.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/fileio.c b/src/fileio.c
index ce8172df03d..3385da52da0 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -5627,8 +5627,13 @@ provides a file dialog box..")
5627 /* If dir starts with user's homedir, change that to ~. */ 5627 /* If dir starts with user's homedir, change that to ~. */
5628 homedir = (char *) egetenv ("HOME"); 5628 homedir = (char *) egetenv ("HOME");
5629#ifdef DOS_NT 5629#ifdef DOS_NT
5630 homedir = strcpy (alloca (strlen (homedir) + 1), homedir); 5630 /* homedir can be NULL in temacs, since Vprocess_environment is not
5631 CORRECT_DIR_SEPS (homedir); 5631 yet set up. We shouldn't crash in that case. */
5632 if (homedir != 0)
5633 {
5634 homedir = strcpy (alloca (strlen (homedir) + 1), homedir);
5635 CORRECT_DIR_SEPS (homedir);
5636 }
5632#endif 5637#endif
5633 if (homedir != 0 5638 if (homedir != 0
5634 && STRINGP (dir) 5639 && STRINGP (dir)