https://bugs.winehq.org/show_bug.cgi?id=40694
Bug ID: 40694 Summary: Invalid behavior of "C: && echo haha" or "C: & echo haha" Product: Wine Version: 1.9.10 Hardware: x86 OS: Linux Status: NEW Keywords: download, source, testcase Severity: normal Priority: P2 Component: cmd Assignee: wine-bugs@winehq.org Reporter: fracting@gmail.com Distribution: ---
On Windows, all of "C: && echo haha", "C: || echo haha", "C: & echo haha" works fine.
On Wine, this kinds of command line generates an error of "Can't recognize 'C: ' as an internal or external command, or batch script."
Found by neovim developer: https://tea-ci.org/equalsraf/neovim/39
https://bugs.winehq.org/show_bug.cgi?id=40694
--- Comment #1 from Qian Hong fracting@gmail.com --- An easier way to reproduce is just: "C: &"
https://bugs.winehq.org/show_bug.cgi?id=40694
--- Comment #2 from Qian Hong fracting@gmail.com --- One more test case:
"C: > NUL"
https://bugs.winehq.org/show_bug.cgi?id=40694
winetest@luukku.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |winetest@luukku.com
--- Comment #3 from winetest@luukku.com --- Basically wine is lacking the ability to swap drives using command: C: ?
https://bugs.winehq.org/show_bug.cgi?id=40694
Bruno Jesus 00cpxxx@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |crramirez@gmail.com
--- Comment #4 from Bruno Jesus 00cpxxx@gmail.com --- Adding Carlos due to his recent work in cmd, maybe he has any ideas.
https://bugs.winehq.org/show_bug.cgi?id=40694
--- Comment #5 from Qian Hong fracting@gmail.com --- (In reply to winetest from comment #3)
Basically wine is lacking the ability to swap drives using command: C: ?
Not exactly.
Swapping drives using command "C:" works stand alone; However, when "C:" is followed by "&" or ">", Wine cmd fails.
https://bugs.winehq.org/show_bug.cgi?id=40694
Vijay Kamuju infyquest@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |kp-pav@yandex.ru
--- Comment #6 from Vijay Kamuju infyquest@gmail.com --- *** Bug 44133 has been marked as a duplicate of this bug. ***
https://bugs.winehq.org/show_bug.cgi?id=40694
Vijay Kamuju infyquest@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |infyquest@gmail.com
--- Comment #7 from Vijay Kamuju infyquest@gmail.com --- fix sent https://source.winehq.org/patches/data/139765
https://bugs.winehq.org/show_bug.cgi?id=40694
--- Comment #8 from Vijay Kamuju infyquest@gmail.com --- new patch https://source.winehq.org/patches/data/139785
https://bugs.winehq.org/show_bug.cgi?id=40694
Jason Edmeades us@edmeades.me.uk changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |us@edmeades.me.uk
--- Comment #9 from Jason Edmeades us@edmeades.me.uk --- That patch is wrong - you need to keep spaces, otherwise something simple like "echo abc >a.a" gives different output (it should keep the spaces). I think it needs to be handled elsewhere, will take a look
(In addition the patch should be WCHAR *tend = command + *commandLen - 1; (not +1) otherwise nothing works)
I'll try to take a look
https://bugs.winehq.org/show_bug.cgi?id=40694
--- Comment #10 from Gijs Vermeulen gijsvrm@gmail.com --- (In reply to Jason Edmeades from comment #9)
Just for reference, there was another patch to fix this bug here: https://www.winehq.org/pipermail/wine-patches/2017-September/165017.html
https://bugs.winehq.org/show_bug.cgi?id=40694
--- Comment #11 from Jason Edmeades us@edmeades.me.uk --- Was there any follow on as to why it was rejected? Looking at it I dont like the " && !(strlenW(cmd) >= 3 && cmd[2] != ' '))" part
I just was experimenting and came up with a similar (slightly cleaner) patch (attaching in a few mins). In the absence of any other comments, I'll send it next time I'm submitting patches.
https://bugs.winehq.org/show_bug.cgi?id=40694
--- Comment #12 from Gijs Vermeulen gijsvrm@gmail.com --- (In reply to Jason Edmeades from comment #11)
I couldn't find any replies to the patch, so it seems it just got lost without review.
https://bugs.winehq.org/show_bug.cgi?id=40694
--- Comment #13 from Jason Edmeades us@edmeades.me.uk --- Created attachment 61701 --> https://bugs.winehq.org/attachment.cgi?id=61701 patch
https://bugs.winehq.org/show_bug.cgi?id=40694
Jason Edmeades us@edmeades.me.uk changed:
What |Removed |Added ---------------------------------------------------------------------------- Assignee|wine-bugs@winehq.org |us@edmeades.me.uk
https://bugs.winehq.org/show_bug.cgi?id=40694
Jason Edmeades us@edmeades.me.uk changed:
What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED Status|NEW |RESOLVED Fixed by SHA1| |daee8b753c52011d1dd745e399c | |be25ac9e9ac47
--- Comment #14 from Jason Edmeades us@edmeades.me.uk --- Committed
https://bugs.winehq.org/show_bug.cgi?id=40694
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #15 from Alexandre Julliard julliard@winehq.org --- Closing bugs fixed in 3.12.
https://bugs.winehq.org/show_bug.cgi?id=40694
Michael Stefaniuc mstefani@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|--- |3.0.x
https://bugs.winehq.org/show_bug.cgi?id=40694
Michael Stefaniuc mstefani@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|3.0.x |---
--- Comment #16 from Michael Stefaniuc mstefani@winehq.org --- Removing the 3.0.x milestone from bugs included in 3.0.3.