1
0
mirror of https://git.FreeBSD.org/src.git synced 2025-01-02 12:20:51 +00:00

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:
Jordan Sissel 2007-02-23 18:41:12 +00:00
parent c8651f7400
commit ee35eb7aa1
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=166911

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 {