]> git.mxchange.org Git - flightgear.git/commitdiff
Support relative paths in 'loadxml' command
authorJames Turner <zakalawe@mac.com>
Sun, 15 Aug 2010 10:02:15 +0000 (11:02 +0100)
committerJames Turner <zakalawe@mac.com>
Sun, 15 Aug 2010 10:02:15 +0000 (11:02 +0100)
(relative to FG_ROOT or an aircraft dir)

src/Main/fg_commands.cxx

index c277b6b73a4bd259636b8b81bf033768a4ee1cc1..ddeab463bcaabea3626c116c5469686b34a5f70d 100644 (file)
@@ -1349,6 +1349,10 @@ do_load_xml_to_proptree(const SGPropertyNode * arg)
     if (file.extension() != "xml")
         file.concat(".xml");
 
+    if (file.isRelative()) {
+      file = globals->resolve_maybe_aircraft_path(file.str());
+    }
+
     if (!fgValidatePath(file.c_str(), false)) {
         SG_LOG(SG_IO, SG_ALERT, "loadxml: reading '" << file.str() << "' denied "
                 "(unauthorized access)");