]> git.mxchange.org Git - flightgear.git/commitdiff
Restore options *processing* order (which is now distinct from *parsing* order),...
authorJames Turner <zakalawe@mac.com>
Mon, 31 Oct 2011 13:08:58 +0000 (13:08 +0000)
committerJames Turner <zakalawe@mac.com>
Mon, 31 Oct 2011 13:08:58 +0000 (13:08 +0000)
src/Main/options.cxx

index 62677a5fda0452fba7f7bc77b6a1f13536bcd4b0..b6f4598eb95f8e269bca259a91f0266edc002a79 100644 (file)
@@ -1951,14 +1951,17 @@ void Options::processOptions()
     exit(0);
   }
   
-  BOOST_FOREACH(const OptionValue& v, p->values) {
-    int result = p->processOption(v.desc, v.value);
+  // proces options in LIFO order, so earlier (first in) options are processed
+  // after, and hence override, later specified options.
+  OptionValueVec::const_reverse_iterator it = p->values.rbegin();
+  for (; it != p->values.rend(); ++it) {
+    int result = p->processOption(it->desc, it->value);
     if (result == FG_OPTIONS_ERROR) {
       showUsage();
       exit(-1);
     }
   }
-  
+
   BOOST_FOREACH(const SGPath& file, p->propertyFiles) {
     if (!file.exists()) {
       SG_LOG(SG_GENERAL, SG_ALERT, "config file not found:" << file.str());