]> git.mxchange.org Git - flightgear.git/commitdiff
Fix fgValidatePath on Windows
authorJames Turner <zakalawe@mac.com>
Mon, 4 Jul 2016 21:22:32 +0000 (22:22 +0100)
committerRoland Haeder <roland@mxchange.org>
Thu, 22 Sep 2016 21:27:47 +0000 (23:27 +0200)
src/Main/util.cxx

index 685e34d590fbd99c0701e991ab70dd57febc8e78..21eebf3f6ac5176be698c09b5fd00be824245ecc 100644 (file)
@@ -94,13 +94,9 @@ void fgInitAllowedPaths()
     write_allowed_paths.clear();
     std::string fg_root = globals->get_fg_root().realpath().utf8Str();
     std::string fg_home = globals->get_fg_home().realpath().utf8Str();
-#if defined(_MSC_VER) /*for MS compilers */ || defined(_WIN32) /*needed for non MS windows compilers like MingW*/
-     std::string sep = "\\";
-#else
-     std::string sep = "/";
-#endif
-    read_allowed_paths.push_back(fg_root + sep + "*");
-    read_allowed_paths.push_back(fg_home + sep + "*");
+
+       read_allowed_paths.push_back(fg_root + "/*");
+    read_allowed_paths.push_back(fg_home + "/*");
     read_allowed_paths.push_back(fg_root);
     read_allowed_paths.push_back(fg_home);
 
@@ -122,19 +118,19 @@ void fgInitAllowedPaths()
                                    "or fgInitAllowedPaths() called too early");
               exit(-1);
           }
-          read_allowed_paths.push_back(it->realpath().utf8Str() + sep + "*");
+          read_allowed_paths.push_back(it->realpath().utf8Str() + "/*");
           read_allowed_paths.push_back(it->realpath().utf8Str());
       }
 
-    write_allowed_paths.push_back(fg_home + sep + "*.sav");
-    write_allowed_paths.push_back(fg_home + sep + "*.log");
-    write_allowed_paths.push_back(fg_home + sep + "cache" + sep + "*");
-    write_allowed_paths.push_back(fg_home + sep + "Export" + sep + "*");
-    write_allowed_paths.push_back(fg_home + sep + "state" + sep + "*.xml");
-    write_allowed_paths.push_back(fg_home + sep + "aircraft-data" + sep + "*.xml");
-    write_allowed_paths.push_back(fg_home + sep + "Wildfire" + sep + "*.xml");
-    write_allowed_paths.push_back(fg_home + sep + "runtime-jetways" + sep + "*.xml");
-    write_allowed_paths.push_back(fg_home + sep + "Input" + sep + "Joysticks" + sep + "*.xml");
+    write_allowed_paths.push_back(fg_home + "/*.sav");
+    write_allowed_paths.push_back(fg_home + "/*.log");
+    write_allowed_paths.push_back(fg_home + "/cache/*");
+    write_allowed_paths.push_back(fg_home + "/Export/*");
+    write_allowed_paths.push_back(fg_home + "/state/*.xml");
+    write_allowed_paths.push_back(fg_home + "/aircraft-data/*.xml");
+    write_allowed_paths.push_back(fg_home + "/Wildfire/*.xml");
+    write_allowed_paths.push_back(fg_home + "/runtime-jetway/*.xml");
+    write_allowed_paths.push_back(fg_home + "/Input/Joysticks/*.xml");
     
     // Check that it works
     std::string homePath = globals->get_fg_home().utf8Str();