From a21dfe37d65a2a3fd564efaf9a132493d03e3db2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Adam=20Go=C5=82=C4=99biowski?= Date: Sun, 10 Apr 2005 09:49:54 +0000 Subject: [PATCH] - look for config files in sane locations, not the current dir Changed files: freecnc-paths.patch -> 1.2 --- freecnc-paths.patch | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/freecnc-paths.patch b/freecnc-paths.patch index 41f96b6..d9ae8e8 100644 --- a/freecnc-paths.patch +++ b/freecnc-paths.patch @@ -24,3 +24,32 @@ lf += "/freecnc.log"; VFS_PreInit(binpath.c_str()); +--- freecnc-20050409/src/misc/args.cpp.orig 2005-04-10 00:40:22.000000000 +0200 ++++ freecnc-20050409/src/misc/args.cpp 2005-04-10 01:33:21.000000000 +0200 +@@ -55,6 +55,15 @@ + return config; + } + ++std::string ConfigPath(std::string filename) ++{ ++ std::string f; ++ f=getenv("HOME_ETC") ? getenv("HOME_ETC") : getenv("HOME"); ++ f+="/.freecnc/"; ++ f+=filename; ++ return f; ++} ++ + /** function to parse command line arguments + * @param number of arguments + * @param pointer to array of arguments +@@ -69,8 +78,8 @@ + shared_ptr internal_ini; + + try { +- freecnc_ini = GetConfig("freecnc.ini"); +- internal_ini = GetConfig("internal-global.ini"); ++ freecnc_ini = GetConfig(ConfigPath("freecnc.ini")); ++ internal_ini = GetConfig(ConfigPath("internal-global.ini")); + } catch(runtime_error& e) { + logger->error("%s\n",e.what()); + return false; -- 2.43.0