mail[Wesnoth-commits] r44634 - /trunk/src/filesystem.cpp


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by timotei_cluj on July 24, 2010 - 18:26:
Author: timotei
Date: Sat Jul 24 18:26:59 2010
New Revision: 44634

URL: http://svn.gna.org/viewcvs/wesnoth?rev=44634&view=rev
Log:
enable absolute paths in --config-dir on non-windows OS-es

Modified:
    trunk/src/filesystem.cpp

Modified: trunk/src/filesystem.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/filesystem.cpp?rev=44634&r1=44633&r2=44634&view=diff
==============================================================================
--- trunk/src/filesystem.cpp (original)
+++ trunk/src/filesystem.cpp Sat Jul 24 18:26:59 2010
@@ -536,7 +536,11 @@
        } else {
                other:
                std::string home = home_str ? home_str : ".";
-               game_config::preferences_dir = home + "/" + path;
+
+               if (path[0] == '/')
+                       game_config::preferences_dir = path;
+               else
+                       game_config::preferences_dir = home + "/" + path;
        }
 #else
        if (path.empty()) path = path2;
@@ -556,7 +560,11 @@
 #else
        const char* home_str = getenv("HOME");
        std::string home = home_str ? home_str : ".";
-       game_config::preferences_dir = home + std::string("/") + path;
+
+       if (path[0] == '/')
+               game_config::preferences_dir = path;
+       else
+               game_config::preferences_dir = home + std::string("/") + path;
 #endif
 #endif
 




Related Messages


Powered by MHonArc, Updated Sat Jul 24 18:40:06 2010