diff -r a1da58215b65 -r 4a624c071ca9 brewco/rdrecipes.c --- a/brewco/rdrecipes.c Thu Dec 17 22:45:54 2015 +0100 +++ b/brewco/rdrecipes.c Sun Dec 20 20:37:40 2015 +0100 @@ -26,6 +26,7 @@ #include "xutil.h" extern int debug; +extern char *etcpath; a_recipe *recipes = NULL; @@ -288,13 +289,7 @@ /* * Now write the XML recipes */ - if (getenv((char *)"USER") == NULL) { - mypath = xstrcpy((char *)"/root"); - } else { - mypath = xstrcpy(getenv((char *)"HOME")); - } - mypath = xstrcat(mypath, (char *)"/.brewco/etc/"); - mkdirs(mypath, 0755); + mypath = xstrcpy(etcpath); mypath = xstrcat(mypath, (char *)"recipes.xml"); if (debug) @@ -571,18 +566,10 @@ xmlNodePtr cur; a_recipe *recipe; - syslog(LOG_NOTICE, "HOME='%s' USER='%s' LOGNAME='%s'", MBSE_SS(getenv((char *)"HOME")), MBSE_SS(getenv((char *)"USER")), MBSE_SS(getenv((char *)"LOGNAME"))); - /* * Search config file */ - if (getenv((char *)"USER") == NULL) { - mypath = xstrcpy((char *)"/root"); - } else { - mypath = xstrcpy(getenv((char *)"HOME")); - } - mypath = xstrcat(mypath, (char *)"/.brewco/etc/"); - mkdirs(mypath, 0755); + mypath = xstrcpy(etcpath); mypath = xstrcat(mypath, (char *)"recipes.xml"); /*