Script "call" cmd improperly checks WinSCP-specific switches
I recently upgraded from WinSCP 3.8 to 4.x (I experienced the following failure on both 4.0.7 and 4.1.3beta). The problem I'm seeing is that WinSCP looks for and also validates switches on the script "call" command. This is improper, because "call" invokes a remote command that has nothing to do with WinSCP's internal script syntax.
This is a serious issue for me; it prevents me from using the call command for anything but running a remote script that doesn't take parameters.
An example of a command that will (currently) fail every time is the example given in WinSCP's own site:
call mysqldump --opt -u USERNAME --password=PASSWORD --all-databases > all_databases.sql
I downloaded the source, and think I have found this bug (copied below, from Script.cpp). Note that the expression "if (!Switches ...)" seems like it should really be: "if (Switches...)".
void __fastcall TScriptCommands::CheckParams(TOptions * Parameters, bool Switches) { AnsiString Switch; if (!Switches && Parameters->UnusedSwitch(Switch)) { throw Exception(FMTLOAD(SCRIPT_UNKNOWN_SWITCH, (Switch))); } }