[Bug 21047] cmd does not handle FOR /F %%a in ('command') properly

wine-bugs at winehq.org wine-bugs at winehq.org
Wed Jan 6 17:04:21 CST 2010


http://bugs.winehq.org/show_bug.cgi?id=21047





--- Comment #2 from Jason Edmeades <us at edmeades.me.uk>  2010-01-06 17:04:20 ---
Created an attachment (id=25593)
 --> (http://bugs.winehq.org/attachment.cgi?id=25593)
Fixes basic case

This will fix the basic case listed in the comment (where command is eg. 'echo
a b c') but will not solve the reported problem.

There are 2 halfs to solve the reported problem and support for /F better:
1. You need to convert the 'delims' if supplied into a parameter passed into
WCMD_parameter, and all other callers should use the default (whitespace) -
Without this the reported problem would work but other simple for /F commands
will fail

2. tokens needs supporting - currently we assume the first thing on the line is
the only token, but we need to support eg. 1,3,4* which means 1st, 3rd and 4th
'parameter' gets mapped to variable name, variable name+1, variable name+2, and
+3 for the rest (eg for /F "tokens=1,3,4*" %a in ('echo a b c d e f g') do echo
%a %b %c rest:%d blank:%e)

Feel free to add a test when you get the test infrastructure in, and submit the
patch / clean it up

-- 
Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email
Do not reply to this email, post in Bugzilla using the
above URL to reply.
------- You are receiving this mail because: -------
You are watching all bug changes.



More information about the wine-bugs mailing list