[Flightgear-devel] Re: [Flightgear-cvslogs] CVS: FlightGear/src/Main fg_init.cxx, 1.115, 1.116
Erik Hofman wrote : Update of /var/cvs/FlightGear-0.9/FlightGear/src/Main In directory baron:/tmp/cvs-serv24714 Modified Files: fg_init.cxx Log Message: Geoff Air: RE: --aircraft=ufo in system.fgfsrc is ignored To change a 'feature', one that has been mentioned here many times, and again recently, place the following code block into fgInitFGAircraft. In its favour, I would argue this means FG can be run without a command line, provided FG_ROOT has been set in the environment, and that seems to me, as it should be ... ;=)) Perhaps the only counter, is that system.fgfsrc is read twice, but so are others, like .fgfsrc, for other (local) options ... or system.fgfsrc should .nt. be used for 'aircraft' ? Well, reading this piece of code, I don't see how it could work. see below : Index: fg_init.cxx === RCS file: /var/cvs/FlightGear-0.9/FlightGear/src/Main/fg_init.cxx,v retrieving revision 1.115 retrieving revision 1.116 diff -C2 -r1.115 -r1.116 *** fg_init.cxx 27 Dec 2004 17:35:22 - 1.115 --- fg_init.cxx 29 Jan 2005 10:22:44 - 1.116 *** *** 344,347 --- 344,353 if ( !aircraft.empty() ) { Aircraft not empty here, otherwise the test had failed SG_LOG(SG_INPUT, SG_INFO, aircraft = aircraft ); This shouldn't change the aircraft variable + if ( aircraft.empty() ) { useless test because aircraft is not empty ( see above ) + // Check for $fg_root/system.fgfsrc + SGPath sysconf( globals-get_fg_root() ); + sysconf.append( system.fgfsrc ); + aircraft = fgScanForOption( --aircraft=, sysconf.str() ); + } So the block above is never executed This is dead code. fgSetString(/sim/aircraft, aircraft.c_str() ); } else { -Fred ___ Flightgear-devel mailing list Flightgear-devel@flightgear.org http://mail.flightgear.org/mailman/listinfo/flightgear-devel 2f585eeea02e2c79d7b1d8c4963bae2d
Re: [Flightgear-devel] Re: [Flightgear-cvslogs] CVS: FlightGear/src/Main fg_init.cxx, 1.115, 1.116
Frederic Bouvier wrote: I can revert the patch or someone running windows should provide me a patch instead. Erik Well, reading this piece of code, I don't see how it could work. see below : Index: fg_init.cxx === RCS file: /var/cvs/FlightGear-0.9/FlightGear/src/Main/fg_init.cxx,v retrieving revision 1.115 retrieving revision 1.116 diff -C2 -r1.115 -r1.116 *** fg_init.cxx27 Dec 2004 17:35:22 -1.115 --- fg_init.cxx29 Jan 2005 10:22:44 -1.116 *** *** 344,347 --- 344,353 if ( !aircraft.empty() ) { Aircraft not empty here, otherwise the test had failed SG_LOG(SG_INPUT, SG_INFO, aircraft = aircraft ); This shouldn't change the aircraft variable + if ( aircraft.empty() ) { useless test because aircraft is not empty ( see above ) + // Check for $fg_root/system.fgfsrc + SGPath sysconf( globals-get_fg_root() ); + sysconf.append( system.fgfsrc ); + aircraft = fgScanForOption( --aircraft=, sysconf.str() ); + } So the block above is never executed This is dead code. fgSetString(/sim/aircraft, aircraft.c_str() ); } else { -Fred ___ Flightgear-devel mailing list Flightgear-devel@flightgear.org http://mail.flightgear.org/mailman/listinfo/flightgear-devel 2f585eeea02e2c79d7b1d8c4963bae2d ___ Flightgear-devel mailing list Flightgear-devel@flightgear.org http://mail.flightgear.org/mailman/listinfo/flightgear-devel 2f585eeea02e2c79d7b1d8c4963bae2d
Re: [Flightgear-devel] Re: [Flightgear-cvslogs] CVS: FlightGear/src/Main fg_init.cxx, 1.115, 1.116
Erik Hofman wrote : Frederic Bouvier wrote: I can revert the patch or someone running windows should provide me a patch instead. Or do both, because the current patch seems useless. Is it windows specific ? -Fred ___ Flightgear-devel mailing list Flightgear-devel@flightgear.org http://mail.flightgear.org/mailman/listinfo/flightgear-devel 2f585eeea02e2c79d7b1d8c4963bae2d
Re: [Flightgear-devel] Re: [Flightgear-cvslogs] CVS: FlightGear/src/Main fg_init.cxx, 1.115, 1.116
Frederic Bouvier a écrit : Erik Hofman wrote : Frederic Bouvier wrote: I can revert the patch or someone running windows should provide me a patch instead. Or do both, because the current patch seems useless. Is it windows specific ? This one seems better ( move the added block 3 lines upward ) : cvs -z4 -q diff -u fg_init.cxx (in directory I:\FlightGear\cvs\FlightGear\src\Main\) Index: fg_init.cxx === RCS file: /var/cvs/FlightGear-0.9/FlightGear/src/Main/fg_init.cxx,v retrieving revision 1.116 diff -u -r1.116 fg_init.cxx --- fg_init.cxx29 Jan 2005 10:22:44 -1.116 +++ fg_init.cxx29 Jan 2005 12:56:47 - @@ -340,15 +340,15 @@ } } +if ( aircraft.empty() ) { +// Check for $fg_root/system.fgfsrc +SGPath sysconf( globals-get_fg_root() ); +sysconf.append( system.fgfsrc ); +aircraft = fgScanForOption( --aircraft=, sysconf.str() ); +} // if an aircraft was specified, set the property name if ( !aircraft.empty() ) { SG_LOG(SG_INPUT, SG_INFO, aircraft = aircraft ); -if ( aircraft.empty() ) { -// Check for $fg_root/system.fgfsrc -SGPath sysconf( globals-get_fg_root() ); -sysconf.append( system.fgfsrc ); -aircraft = fgScanForOption( --aircraft=, sysconf.str() ); -} fgSetString(/sim/aircraft, aircraft.c_str() ); } else { SG_LOG(SG_INPUT, SG_INFO, No user specified aircraft, using default ); ___ Flightgear-devel mailing list Flightgear-devel@flightgear.org http://mail.flightgear.org/mailman/listinfo/flightgear-devel 2f585eeea02e2c79d7b1d8c4963bae2d
Re: [Flightgear-devel] Re: [Flightgear-cvslogs] CVS: FlightGear/src/Main fg_init.cxx, 1.115, 1.116
Frederic Bouvier wrote: Frederic Bouvier a écrit : Erik Hofman wrote : Frederic Bouvier wrote: I can revert the patch or someone running windows should provide me a patch instead. Or do both, because the current patch seems useless. Is it windows specific ? This one seems better ( move the added block 3 lines upward ) : Ok thanks, it's committed now. Just a note to developers, only real patches are accepted from now on. All other suggestions on how to fix things will be silently ignored by me. Erik ___ Flightgear-devel mailing list Flightgear-devel@flightgear.org http://mail.flightgear.org/mailman/listinfo/flightgear-devel 2f585eeea02e2c79d7b1d8c4963bae2d