]> git.mxchange.org Git - flightgear.git/commitdiff
Update for changed SGPath::realpath signature
authorJames Turner <zakalawe@mac.com>
Mon, 4 Jul 2016 08:06:42 +0000 (09:06 +0100)
committerRoland Haeder <roland@mxchange.org>
Thu, 22 Sep 2016 21:27:47 +0000 (23:27 +0200)
src/Main/options.cxx
src/Main/util.cxx

index ffacd45bb3742a8205964c61d305405dbad39da3..3ac5d2eecb6a33a3e5934df4a242b87582b9d8ad 100644 (file)
@@ -2084,7 +2084,7 @@ void Options::initAircraft()
     // is a symlink (which is not a problem, since it was given as is by the
     // user---this is very different from a symlink *under* the aircraft dir
     // or a scenery dir).
-    fgSetString("/sim/aircraft-dir", aircraftDirPath.realpath().c_str());
+    fgSetString("/sim/aircraft-dir", aircraftDirPath.realpath().utf8Str());
   }
 
     if (isOptionSet("state")) {
index 616bbdcd1bc387e5147c6b7984f21bdf8e1e59ca..685e34d590fbd99c0701e991ab70dd57febc8e78 100644 (file)
@@ -81,7 +81,7 @@ static string_list write_allowed_paths;
  */
 void fgInitAllowedPaths()
 {
-    if(SGPath("ygjmyfvhhnvdoesnotexist").realpath() == "ygjmyfvhhnvdoesnotexist"){
+    if(SGPath("ygjmyfvhhnvdoesnotexist").realpath().utf8Str() == "ygjmyfvhhnvdoesnotexist"){
         // Forbid using this version of fgValidatePath() with older
         // (not normalizing non-existent files) versions of realpath(),
         // as that would be a security hole
@@ -92,8 +92,8 @@ void fgInitAllowedPaths()
     }
     read_allowed_paths.clear();
     write_allowed_paths.clear();
-    std::string fg_root = globals->get_fg_root().realpath();
-    std::string fg_home = globals->get_fg_home().realpath();
+    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
@@ -122,8 +122,8 @@ void fgInitAllowedPaths()
                                    "or fgInitAllowedPaths() called too early");
               exit(-1);
           }
-          read_allowed_paths.push_back(it->realpath() + sep + "*");
-          read_allowed_paths.push_back(it->realpath());
+          read_allowed_paths.push_back(it->realpath().utf8Str() + sep + "*");
+          read_allowed_paths.push_back(it->realpath().utf8Str());
       }
 
     write_allowed_paths.push_back(fg_home + sep + "*.sav");
@@ -162,7 +162,7 @@ void fgInitAllowedPaths()
 SGPath fgValidatePath (const SGPath& path, bool write)
 {
     // Normalize the path (prevents ../../.. or symlink trickery)
-    std::string normed_path = path.realpath();
+    std::string normed_path = path.realpath().utf8Str();
     
     const string_list& allowed_paths(write ? write_allowed_paths : read_allowed_paths);
     size_t star_pos;