summaryrefslogtreecommitdiff
path: root/lib/mesa/src/util/xmlconfig.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/mesa/src/util/xmlconfig.c')
-rw-r--r--lib/mesa/src/util/xmlconfig.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/lib/mesa/src/util/xmlconfig.c b/lib/mesa/src/util/xmlconfig.c
index 62b163be2..7a753e37e 100644
--- a/lib/mesa/src/util/xmlconfig.c
+++ b/lib/mesa/src/util/xmlconfig.c
@@ -1173,16 +1173,9 @@ initOptionCache(driOptionCache *cache, const driOptionCache *info)
#define DATADIR "/usr/share"
#endif
-static const char *datadir = DATADIR "/drirc.d";
static const char *execname;
void
-driInjectDataDir(const char *dir)
-{
- datadir = dir;
-}
-
-void
driInjectExecName(const char *exec)
{
execname = exec;
@@ -1216,10 +1209,15 @@ driParseConfigFiles(driOptionCache *cache, const driOptionCache *info,
userData.execName = execname;
#if WITH_XMLCONFIG
- char *home;
-
- parseConfigDir(&userData, datadir);
- parseOneConfigFile(&userData, SYSCONFDIR "/drirc");
+ char *home, *configdir;
+
+ /* parse from either $DRIRC_CONFIGDIR or $datadir/drirc.d */
+ if ((configdir = getenv("DRIRC_CONFIGDIR")))
+ parseConfigDir(&userData, configdir);
+ else {
+ parseConfigDir(&userData, DATADIR "/drirc.d");
+ parseOneConfigFile(&userData, SYSCONFDIR "/drirc");
+ }
if ((home = getenv("HOME"))) {
char filename[PATH_MAX];