]> git.mxchange.org Git - flightgear.git/commitdiff
Create FG_HOME if not found
authorJames Turner <zakalawe@mac.com>
Sun, 16 Jun 2013 16:44:08 +0000 (17:44 +0100)
committerJames Turner <zakalawe@mac.com>
Sun, 16 Jun 2013 18:50:30 +0000 (19:50 +0100)
src/Main/fg_init.cxx

index 436dd486d86d1f5a880d30b36288d7d99ff2940c..e72e24e11edf6ce7b513ee9b3f04ccf3729a3f7f 100644 (file)
@@ -432,12 +432,18 @@ void fgInitHome()
 {
   SGPath dataPath = SGPath::fromEnv("FG_HOME", platformDefaultDataPath());
   globals->set_fg_home(dataPath.c_str());
+    
+    simgear::Dir fgHome(dataPath);
+    if (!fgHome.exists()) {
+        fgHome.create(0755);
+    }
 }
 
 // Read in configuration (file and command line)
 bool fgInitConfig ( int argc, char **argv )
 {
     SGPath dataPath = globals->get_fg_home();
+    
     simgear::Dir exportDir(simgear::Dir(dataPath).file("Export"));
     if (!exportDir.exists()) {
       exportDir.create(0777);