From 931f4266fb43cd3df2110fdacc71060fcdb383d5 Mon Sep 17 00:00:00 2001 From: James Turner Date: Sun, 9 Jun 2013 19:11:41 +0100 Subject: [PATCH] TerraSync: fix dir creation. Separate the default path logic, from the 'create if not found' logic. --- src/Main/options.cxx | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/Main/options.cxx b/src/Main/options.cxx index cbc1c2fec..0a1f2f149 100644 --- a/src/Main/options.cxx +++ b/src/Main/options.cxx @@ -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()) { -- 2.39.5