/** @brief Set the default configuration file */
static void set_configfile(void) {
#if !_WIN32
- if(!configfile)
- byte_xasprintf(&configfile, "%s/config", pkgconfdir);
+ if(!configfile) {
+ configfile = getenv("DISORDER_CONFIG");
+ if(!configfile)
+ byte_xasprintf(&configfile, "%s/config", pkgconfdir);
+ }
#endif
}
/** @brief Return the path to user's personal configuration file */
char *config_userconf(void) {
+ char *t;
+ if((t = getenv("DISORDER_USERCONFIG"))) return xstrdup(t);
return profile_filename("passwd");
}
char *s;
set_configfile();
- if(!strchr(pw->pw_name, '/')) {
+ if((s = getenv("DISORDER_USERCONFIG_SYS")))
+ return xstrdup(s);
+ else if(!strchr(pw->pw_name, '/')) {
byte_xasprintf(&s, "%s.%s", configfile, pw->pw_name);
return s;
} else