Mercurial > emacs
comparison src/fileio.c @ 34104:c9980ec72766
(Fread_file_name) [DOS_NT]: Don't crash if homedir is NULL.
author | Eli Zaretskii <eliz@gnu.org> |
---|---|
date | Sat, 02 Dec 2000 11:16:13 +0000 |
parents | bc4bfaca97aa |
children | ce6d3ca84e6d |
comparison
equal
deleted
inserted
replaced
34103:d23d6a3e8128 | 34104:c9980ec72766 |
---|---|
5625 } | 5625 } |
5626 | 5626 |
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) |
5635 && !strncmp (homedir, XSTRING (dir)->data, strlen (homedir)) | 5640 && !strncmp (homedir, XSTRING (dir)->data, strlen (homedir)) |
5636 && IS_DIRECTORY_SEP (XSTRING (dir)->data[strlen (homedir)])) | 5641 && IS_DIRECTORY_SEP (XSTRING (dir)->data[strlen (homedir)])) |