https://bugs.winehq.org/show_bug.cgi?id=44441
Bug ID: 44441 Summary: for loop reading a file strips out double quotes and then equals Product: Wine Version: 1.8.5 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: cmd Assignee: wine-bugs@winehq.org Reporter: india.mcq@gmail.com Distribution: ---
Created attachment 60386 --> https://bugs.winehq.org/attachment.cgi?id=60386 test batch file, test.txt, results for Windows and Wine
My batch file has this for loop that reads a line at a time. FOR /F "eol=# tokens=2 delims=;" %%i in (%tasklist%) do call :%%i
It feeds everything after the semicolon to a called function that is at the start of the line. The full line is like this: comment area ;xslt xsltname "param1=info1 param2=info2" blank.xml dostuff.xslt
Windows passes exactly that to the called function xslt.
But Wine cmd does two unexpected things.
First it strips out the double quotes. But when the params are received by the receiving function in this case :xslt then the equals are also stripped out.
Thus the received params are: %~0 = :xslt %~1 = xsltname %~2 = param1 %~3 = info1 %~4 = param2 %~5 = info2 %~6 = blank.xml %~7 = dostuff.xslt
While Windows would have the params as: %~0 = :xslt %~1 = xsltname %~2 = param1=info1 param2=info2 %~3 = blank.xml %~4 = dostuff.xslt
As it is reading a text file there is nothing I can do to pre manipulate the text file.
I can see that striping out the equals is a good thing at times but I don't want that here.
Is this fixable by configuration? Or is it a bug?
Ian