Remove trailing / or \ in path_userdata (probably fixes world deletion on Windows)
authorPerttu Ahola <celeron55@gmail.com>
Wed, 2 Nov 2011 11:43:00 +0000 (13:43 +0200)
committerPerttu Ahola <celeron55@gmail.com>
Wed, 2 Nov 2011 11:43:00 +0000 (13:43 +0200)
src/porting.cpp

index 217f0926e129b3be02d0fc589b152159944a50e3..f349c0ce5e8c877660b7beab497145b57eee76a5 100644 (file)
@@ -129,8 +129,8 @@ void initializePaths()
        // Use "./bin/../data"
        path_data = std::string(buf) + DIR_DELIM ".." DIR_DELIM "data";
                
-       // Use "./bin/../"
-       path_userdata = std::string(buf) + DIR_DELIM ".." DIR_DELIM;
+       // Use "./bin/.."
+       path_userdata = std::string(buf) + DIR_DELIM "..";
 
        /*
                Linux
@@ -149,7 +149,7 @@ void initializePaths()
        path_data = std::string(buf) + "/../data";
                
        // Use "./bin/../"
-       path_userdata = std::string(buf) + "/../";
+       path_userdata = std::string(buf) + "/..";
        
        /*
                OS X
@@ -160,7 +160,7 @@ void initializePaths()
        dstream<<"WARNING: Relative path not properly supported on OS X and FreeBSD"
                        <<std::endl;
        path_data = std::string("../data");
-       path_userdata = std::string("../");
+       path_userdata = std::string("..");
 
        #endif