https://bugs.winehq.org/show_bug.cgi?id=42508
--- Comment #3 from Bas Weelinck hydratech@gmail.com --- Created attachment 57563 --> https://bugs.winehq.org/attachment.cgi?id=57563 output log showing cmd quote handling parse behaviour for arguments surrounded by quotes but containing escaped quotes.
I spoke to madewokherd in #winehackers yesterday and he suggested the same. As such I have appended a patch for your testing pleasure. It works for quoted arguments containing no spaces, but has the problems you described when the argument contains spaces. So we definitely want to add surrounding quotes.
I did run into another issue though, it seems WCMD_parameter_with_delims does not handle escaped quotes. I am not sure if it is a bug or not, but it does seem odd to me. It can cause WCMD_parameter to return an argument that is not actually surrounded by quotes, but does start with one. The quote block is terminated by the escaped quote, whereafter the next delimiter terminates the entire argument.
I've attached output of a wine running with the patch and the debug channels start,cmd,exec,process where you can observe this behaviour.