]> git.mxchange.org Git - flightgear.git/commitdiff
Ignore not-found 'config file' arguments.
authorJames Turner <zakalawe@mac.com>
Thu, 27 Mar 2014 08:05:02 +0000 (08:05 +0000)
committerJames Turner <zakalawe@mac.com>
Thu, 27 Mar 2014 08:05:02 +0000 (08:05 +0000)
Fixes confusing startup behaviour with malformed args, when
an argument accidentally contains a space (e.g. a park-pos or
protocol desc). In this case we treat the parts after the space as an XML config file name. When we can't find this file, we
completely abandon options setup, which causes many downstream
errors.

Change the behaviour so we warn in this case, but carry on with normal startup.

src/Main/options.cxx

index 9ec346493123b6622741edbfc217152f9cb0ab1f..2cf9649448edd9f6697508bc09c9c7385f7712dc 100644 (file)
@@ -1842,10 +1842,9 @@ void Options::init(int argc, char **argv, const SGPath& appDataPath)
       SGPath f(argv[i]);
       if (!f.exists()) {
         SG_LOG(SG_GENERAL, SG_ALERT, "config file not found:" << f.str());
-        return;
+      } else {
+        p->propertyFiles.push_back(f);
       }
-      
-      p->propertyFiles.push_back(f);
     }
   } // of arguments iteration
   p->insertGroupMarker(); // command line is one group
@@ -2170,11 +2169,6 @@ OptionResult Options::processOptions()
   }
 
   BOOST_FOREACH(const SGPath& file, p->propertyFiles) {
-    if (!file.exists()) {
-      SG_LOG(SG_GENERAL, SG_ALERT, "config file not found:" << file.str());
-      continue;
-    }
-    
     SG_LOG(SG_GENERAL, SG_INFO,
            "Reading command-line property file " << file.str());
          readProperties(file.str(), globals->get_props());