https://bugs.winehq.org/show_bug.cgi?id=48020
Bug ID: 48020 Summary: Testagent: Accept a raw command line in Run() as an alternative to argv. Product: Wine-Testbot Version: unspecified Hardware: x86 OS: Linux Status: NEW Severity: normal Priority: P2 Component: unknown Assignee: wine-bugs@winehq.org Reporter: fgouget@codeweavers.com Distribution: ---
Windows applications that have a standard main() entry-point taking in argv and argc parameters parse their command line the expected / standard way.
But a number of Windows applications parse the command line themselves and usually do it in a buggy way. This is an issue for TestAgent because the client side can only send the command to run in the argc/argv format which means building a command line on the server side in a standard way which may not match the buggy way the application will then parse said command line.
For instance this is an issue with cmd.exe. If the client calls Run(["cmd". "/c", "script.bat >Task.log"]) the server will build a command line of the form '"cmd" "/c" "script.bat >Task.log"' but this results in cmd trying to run '"script.bat >Task.log' which fails because of the extraneous double quote.
Note that cmd fails in the same way if given the 'cmd "/c" "script.bat
Task.log"' command line but then works if given 'cmd /c "script.bat Task.log"'.
A mitigating change would be to not put double-quotes only where necessary. But to be sure to not have more issues TestAgent should allow the client to provide the raw command line instead of the usual argv array.
This could be done by adding a $RUN_CMDLINE flag which could be a Windows-specific TestAgent server feature.