1
0
Fork 0

Allow -jsbsim, -yasim or -uiuc in the name of the configuration file when it resides in it's own subdirectory

This commit is contained in:
ehofman 2003-09-15 16:00:18 +00:00
parent 4d6b14a08c
commit 13d8e0edab

View file

@ -534,9 +534,19 @@ bool fgInitConfig ( int argc, char **argv ) {
aircraft_path.concat("-set.xml"); aircraft_path.concat("-set.xml");
if ( !ulFileExists(aircraft_path.c_str()) ) { 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 = globals->get_fg_root();
aircraft_path.append("Aircraft"); aircraft_path.append("Aircraft");
aircraft_path.append(aircraft); aircraft_path.append(adir);
aircraft_path.append(aircraft); aircraft_path.append(aircraft);
aircraft_path.concat("-set.xml"); aircraft_path.concat("-set.xml");
} }