[resubmit] cmd: Fix cmd's mishandling of quote-enclosed command strings

Wilbert Ho wilbert.ho at gmail.com
Fri Jul 16 18:08:25 CDT 2010

cmd mishandles quote-enclosed command strings because the leading
quote is included in the string when wine searches through the
built-in commands (dir is a builtin, but "dir is not).

$ ./wine cmd.exe /c "dir README"
wine: cannot find L"C:\\windows\\system32\\dir.exe"
File not found

To fix this, offset the string being compared to the array of builtins
by the number of leading quotes before doing the comparison.

 programs/cmd/tests/test_builtins.cmd       |    8 ++++++++
 programs/cmd/tests/test_builtins.cmd.exp |    6 ++++++
 programs/cmd/wcmdmain.c                      |   18 ++++++++++++++----
 3 files changed, 28 insertions(+), 4 deletions(-)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-cmd-Fix-cmd-s-mishandling-of-quote-enclosed-command-.patch
Type: text/x-patch
Size: 3199 bytes
Desc: not available
URL: <http://www.winehq.org/pipermail/wine-patches/attachments/20100716/6532e8a9/attachment.bin>

More information about the wine-patches mailing list