diff --git a/src/Main/fg_init.cxx b/src/Main/fg_init.cxx index e5da97091..38370e9f5 100644 --- a/src/Main/fg_init.cxx +++ b/src/Main/fg_init.cxx @@ -534,9 +534,19 @@ bool fgInitConfig ( int argc, char **argv ) { aircraft_path.concat("-set.xml"); if ( !ulFileExists(aircraft_path.c_str()) ) { + string adir = aircraft; + int pos, alen = adir.length(); + + if ( ((pos = adir.rfind("-jsbsim")) != string::npos) || + ((pos = adir.rfind("-yasim")) != string::npos) || + ((pos = adir.rfind("-uiuc")) != string::npos) ) + { + adir.erase(pos, alen); + } + aircraft_path = globals->get_fg_root(); aircraft_path.append("Aircraft"); - aircraft_path.append(aircraft); + aircraft_path.append(adir); aircraft_path.append(aircraft); aircraft_path.concat("-set.xml"); }