From 851385d989bea7b1b8cc9387e691e559e0fff97e Mon Sep 17 00:00:00 2001 From: Jan-Peter Nilsson Date: Sun, 9 Jan 2011 13:28:35 +0100 Subject: [PATCH] Allow override of OpenMW user configuration path with OPENMW_HOME environment variable --- apps/openmw/path.hpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/apps/openmw/path.hpp b/apps/openmw/path.hpp index 8e8dac09e..914882194 100644 --- a/apps/openmw/path.hpp +++ b/apps/openmw/path.hpp @@ -42,9 +42,16 @@ namespace OMW theBasePath = macBundlePath() + "/Contents/MacOS/"; //FIXME do we have global/local with OSX? #elif OGRE_PLATFORM_LINUX const char* homedir; - if ((homedir = getenv("HOME")) == NULL) - return NULL; - theBasePath = std::string(homedir)+"/."+parApp+"/"; + if ((homedir = getenv("OPENMW_HOME")) != NULL) + { + theBasePath = std::string(homedir)+"/"; + } + else + { + if ((homedir = getenv("HOME")) == NULL) + return NULL; + theBasePath = std::string(homedir)+"/."+parApp+"/"; + } mkdir(theBasePath.c_str(), 0777); #else theBasePath = "";