- look for config files in sane locations, not the current dir
authorAdam Gołębiowski <adamg@pld-linux.org>
Sun, 10 Apr 2005 09:49:54 +0000 (09:49 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    freecnc-paths.patch -> 1.2

freecnc-paths.patch

index 41f96b6..d9ae8e8 100644 (file)
      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<INIFile> 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;
This page took 0.034728 seconds and 4 git commands to generate.