[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 15:12:11 CST 2010


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


Dan Kegel <dank at kegel.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|cmd does not handle for %%a |cmd does not handle FOR /F
                   |in ('command')              |%%a in ('command') properly




--- Comment #1 from Dan Kegel <dank at kegel.com>  2010-01-06 15:12:10 ---
Simple test: a batch file foo.cmd containing
  for /f %%a in ('echo a b c') do echo %%a
should output
  a

That's supposed to work in wine already, but doesn't seem to.
http://source.winehq.org/source/programs/cmd/builtins.c#L888

Here's what one sees with WINEDEBUG=+cmd,+process wine cmd /c foo.cmd
...
trace:cmd:WCMD_for Processing for filespec from item 1 'L"'echo"'
trace:cmd:WCMD_execute command on entry:L"'echo a b c" ((nil)), with
'(null)'='(null)'
trace:cmd:WCMD_execute Redirect 1 to 'L"echo"' (0x44)
trace:cmd:WCMD_execute Command: 'L"'echo a b c"'
trace:cmd:WCMD_execute param1: L"'echo", param2: L"a"
trace:cmd:WCMD_run_program Searching in
'L".;C:\\windows\\system32;C:\\windows"' for 'L"'echo"'
trace:cmd:WCMD_run_program Found as L"Z:\\data\\dkegel\\wine-git\\'echo.*"
trace:cmd:WCMD_run_program Found as L"C:\\windows\\system32\\'echo.*"
trace:cmd:WCMD_run_program ASSUMING INTERNAL
trace:process:CreateProcessW app (null) cmdline L"'echo a b c"
...
trace:process:find_exe_file Trying built-in exe L"C:\\windows\\system32\\'echo
a b c.exe"
File not found

See also http://ss64.com/nt/for_cmd.html
and http://ss64.com/nt/for_f.html

-- 
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