Friends, can I briefly talk about fgrun, please?

Before we continue, let me make clear that I am running fgrun and fgfs on a Linux system.

I tried to disable AI-traffic and traffic-manager by setting up two properties in the advanced options of fgrun:

[CODE]
--prop:/sim/AI-traffic/enabled=0
--prop:/sim/traffic-manager/enabled=0
[/CODE]

I noticed that fgrun generated a command line containing:

[CODE]
"--prop:/sim/AI-traffic/enabled=0"
"--prop:/sim/traffic-manager/enabled=0"
[/CODE]

which made fgfs refuse to be started, complaining about an illegal argument. It does not like the double quotes. And rightly so. The --prop arguments are the only arguments that get the double quotes thrown in for free.

The command line as generated by fgrun is fine when fed to a shell. The shell interprets and absorbs the double quotes before the arguments are passed to fgfs. On Linux fgfs is started directly from run_posix.cxx and is not passed through the shell, which is why the double quotes are passed on to fgfs as part of the arguments.

When looking at the sources, I noticed that the --prop argument is the only option handled in this specific way, which leads me to assume someone fixed a problem for windows systems. It probably was a windows specific fix at some point in time.

I found the code doing it in fgfsrc.cxx on lines 378 and 379:

[CODE]
        if ( strlen( buf ) > 0 )
            os << pfx << "\"--prop:" << buf << "\"";
[/CODE]

I changed this on my system to:

[CODE]
        if ( strlen( buf ) > 0 )
            os << pfx << "--prop:" << buf;
[/CODE]

After that all is well, at least on my Linux system.

It is possible that this change breaks something on windows systems. If it does, I would like to suggest that the specific handling of the --prop argument is taken care of in run_win32.cxx, because that is the place (together with run_posix.cxx) where OS specific solutions are handled.

I would like to suggest to apply these changes to the repository, but I am not sure what will break on windows systems and I am not in the position to test. I do not have windows.

Is there anybody that likes to comment on my suggestions and/or willing to look into the specifics for windows?

Cheers,
M