Print a message to the user and exit(1) if HOME is not set in the users environment.

Originally committed to SVN as r5324.
This commit is contained in:
Amar Takhar 2011-02-08 22:40:55 +00:00
parent 436ea23e4c
commit c603c21b86
1 changed files with 2 additions and 1 deletions

View File

@ -38,7 +38,8 @@ const std::string home() {
char *ehome;
ehome = getenv("HOME");
if (ehome == NULL) {
//XXX: explode here.
printf("The HOME environment variable must be set\n");
exit(1);
}
std::string home(ehome);
free(ehome);