diff -burN abook-0.5.4.orig/abook.c abook-0.5.4/abook.c --- abook-0.5.4.orig/abook.c 2005-09-05 09:05:10.903458032 +0200 +++ abook-0.5.4/abook.c 2005-09-05 09:17:13.733571152 +0200 @@ -70,13 +70,15 @@ { struct stat s; char *dir; + char *home; assert(!is_ui_initialized()); if(alternative_datafile) return; - dir = strconcat(getenv("HOME"), "/" DIR_IN_HOME, NULL); + home = getenv("HOME_ETC") ? getenv("HOME_ETC") : getenv("HOME"); + dir = strconcat(home, "/" DIR_IN_HOME, NULL); assert(dir != NULL); if(stat(dir, &s) == -1) { @@ -207,18 +209,21 @@ set_filenames() { struct stat s; + char * home; if( (stat(getenv("HOME"), &s)) == -1 || ! S_ISDIR(s.st_mode) ) { fprintf(stderr,_("%s is not a valid HOME directory\n"), getenv("HOME") ); exit(EXIT_FAILURE); } + home = getenv("HOME_ETC") ? getenv("HOME_ETC") : getenv("HOME"); + if(!datafile) - datafile = strconcat(getenv("HOME"), "/" DIR_IN_HOME "/" + datafile = strconcat(home, "/" DIR_IN_HOME "/" DATAFILE, NULL); if(!rcfile) - rcfile = strconcat(getenv("HOME"), "/" DIR_IN_HOME "/" + rcfile = strconcat(home, "/" DIR_IN_HOME "/" RCFILE, NULL); atexit(free_filenames);