From bca3494462f0430a97e89a3d8beb69574c1aa18f Mon Sep 17 00:00:00 2001 From: James Turner Date: Sun, 15 Aug 2010 11:02:15 +0100 Subject: [PATCH] Support relative paths in 'loadxml' command (relative to FG_ROOT or an aircraft dir) --- src/Main/fg_commands.cxx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Main/fg_commands.cxx b/src/Main/fg_commands.cxx index c277b6b73..ddeab463b 100644 --- a/src/Main/fg_commands.cxx +++ b/src/Main/fg_commands.cxx @@ -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)");