Commit c1ca3b14 authored by 's avatar
Browse files

CvR:

+ Give an error message if HOME is not set instead of crashing.



git-svn-id: file:///home/svn/mapi/trunk@388 8d5bb341-7cf1-0310-8cf6-ba355fef3186
parent 8bd38418
......@@ -2517,6 +2517,8 @@ static void set_debug()
int
main (int argc, char *argv[])
{
const char *homedir;
parse_arguments (argc, argv);
openlog("MAPID",0,LOG_DAEMON);
......@@ -2544,6 +2546,11 @@ main (int argc, char *argv[])
gflist = malloc(sizeof(global_function_list_t));
homedir = getenv("HOME");
if( homedir == NULL ){
fputs( "Environment variable HOME not set. Giving up.\n", stderr );
exit( 1 );
}
mapid_conf = malloc(sizeof(CONF_FILE)-2+strlen(getenv("HOME")));
sprintf(mapid_conf,CONF_FILE,getenv("HOME"));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment