]> git.mxchange.org Git - flightgear.git/commitdiff
TerraSync: fix dir creation.
authorJames Turner <zakalawe@mac.com>
Sun, 9 Jun 2013 18:11:41 +0000 (19:11 +0100)
committerJames Turner <zakalawe@mac.com>
Sun, 9 Jun 2013 21:57:45 +0000 (22:57 +0100)
Separate the default path logic, from the 'create if
not found' logic.

src/Main/options.cxx

index cbc1c2fecb4b6da2d147127802f01df612d9c37e..0a1f2f149cca98b4bb6864d24c44aac5cb8a0423 100644 (file)
@@ -2041,16 +2041,17 @@ void Options::processOptions()
     if (terrasyncDir.empty()) {
       SGPath p(globals->get_fg_home());
       p.append("TerraSync");
-      if (!p.exists()) {
-        simgear::Dir dd(p);
-        dd.create(0700);
-      }
-      
       terrasyncDir = p.str();
       SG_LOG(SG_GENERAL, SG_INFO,
              "Using default TerraSync dir: " << terrasyncDir);
       fgSetString("/sim/terrasync/scenery-dir", terrasyncDir);
     }
+      
+      SGPath p(terrasyncDir);
+      if (!p.exists()) {
+          simgear::Dir dd(p);
+          dd.create(0700);
+      }
     
     const string_list& scenery_paths(globals->get_fg_scenery());
     if (std::find(scenery_paths.begin(), scenery_paths.end(), terrasyncDir) == scenery_paths.end()) {