Make cu/tip handle when $HOME is not set in the environment.

Approved by: philip
Submitted by: ale
PR: bin/108775
This commit is contained in:
jls 2007-02-23 18:41:12 +00:00
parent 6a2b828982
commit 888dd25b3f

View File

@ -74,7 +74,11 @@ vinit(void)
* Read the .tiprc file in the HOME directory
* for sets
*/
if (strlen(value(HOME)) + sizeof("/.tiprc") > sizeof(file)) {
cp = value(HOME);
if (cp == NULL) {
(void)fprintf(stderr,
"$HOME not set. Skipping check for ~/.tiprc\n");
} else if (strlen(cp) + sizeof("/.tiprc") > sizeof(file)) {
(void)fprintf(stderr, "Home directory path too long: %s\n",
value(HOME));
} else {