https://bugs.winehq.org/show_bug.cgi?id=44338
Bug ID: 44338 Summary: cmd: Brackets are no deliminiter in the condition part of the if command. Product: Wine Version: 3.0-rc5 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: cmd Assignee: wine-bugs@winehq.org Reporter: bernhardu@mailbox.org Distribution: ---
Created attachment 60213 --> https://bugs.winehq.org/attachment.cgi?id=60213 cmd: Change parsing of the if command to avoid parsing the operators.
Found while trying to look into #44236. There a batch script is executed that contains lines as this: --- if (%1)==(p) start /W " " "%SFDIR%WSFplot" wr2300.t35 3 ---
This returns an error like this: --- Syntax error Can't recognize 'p' as an internal or external command, or batch script. ---
It looks like native does handle the brackets differently when contained inside the condition part of the if command.
Attached is a patch that tries to skip the parsing in WCMD_ReadAndParseLine of that part. Therefore it moves most of the content of WCMD_if into a helper and calls that to estimate how long the condition part is.
https://bugs.winehq.org/show_bug.cgi?id=44338
--- Comment #1 from Bernhard Übelacker bernhardu@mailbox.org --- Created attachment 60214 --> https://bugs.winehq.org/attachment.cgi?id=60214 cmd/tests: Test if command with operators containing brackets.
https://bugs.winehq.org/show_bug.cgi?id=44338
Fabian Maurer dark.shadow4@web.de changed:
What |Removed |Added ---------------------------------------------------------------------------- Ever confirmed|0 |1 CC| |dark.shadow4@web.de Keywords| |patch, testcase Status|UNCONFIRMED |NEW
--- Comment #2 from Fabian Maurer dark.shadow4@web.de --- Confirming bug.
https://bugs.winehq.org/show_bug.cgi?id=44338
Vijay Kamuju infyquest@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |infyquest@gmail.com
--- Comment #3 from Vijay Kamuju infyquest@gmail.com --- merge both the patches. remove the commented static for 'int evaluate_if_condition' in builtins.c Also move the extern definition of the function evaluate_if_condition to wcmd.h
https://bugs.winehq.org/show_bug.cgi?id=44338
--- Comment #4 from Vijay Kamuju infyquest@gmail.com --- Also add signoff to the patches
https://bugs.winehq.org/show_bug.cgi?id=44338
Bernhard Übelacker bernhardu@mailbox.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Distribution|--- |Debian
--- Comment #5 from Bernhard Übelacker bernhardu@mailbox.org --- Patch sent: https://www.winehq.org/pipermail/wine-devel/2018-January/121764.html
https://bugs.winehq.org/show_bug.cgi?id=44338
Jason Edmeades us@edmeades.me.uk changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |us@edmeades.me.uk
--- Comment #6 from Jason Edmeades us@edmeades.me.uk --- Bernhard - Was there any feedback for your patch, explanation why it wasnt committed?
https://bugs.winehq.org/show_bug.cgi?id=44338
--- Comment #7 from Bernhard Übelacker bernhardu@mailbox.org --- There was no feedback. This was probably caused by me making patchwatcher not find the signed-of-by line by my usage of "---" in the commit message.
I have rebased the patch and sent it again. https://www.winehq.org/pipermail/wine-devel/2018-July/129804.html
https://bugs.winehq.org/show_bug.cgi?id=44338
--- Comment #8 from Jason Edmeades us@edmeades.me.uk --- For what its worth I think this patch takes the parsing in the right direction. I'm working on 'if' parsing and handling at the moment (I have a set of patches) but to solve some of the more complex problems I need to know where the condition ends, which your patch provides. Hopefully AJ will indicate if there's a problem or not, otherwise its worth asking (he's away at the moment)
https://bugs.winehq.org/show_bug.cgi?id=44338
--- Comment #9 from Bernhard Übelacker bernhardu@mailbox.org --- Sorry for the delay. I have rebased the patch and resent: https://www.winehq.org/pipermail/wine-devel/2019-August/149828.html
https://bugs.winehq.org/show_bug.cgi?id=44338
Bernhard Übelacker bernhardu@mailbox.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution|--- |FIXED Fixed by SHA1| |f238e846e701d2039eceb51f2f6 | |e9d936f8c791c
--- Comment #10 from Bernhard Übelacker bernhardu@mailbox.org --- Wine 4.15 should work as expected. Sorry for not marking it as fixed before.
https://bugs.winehq.org/show_bug.cgi?id=44338
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #11 from Alexandre Julliard julliard@winehq.org --- Closing bugs fixed in 4.16.
https://bugs.winehq.org/show_bug.cgi?id=44338
Matteo Bruni matteo.mystral@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Summary|cmd: Brackets are no |cmd: Brackets are no |deliminiter in the |delimiter for the condition |condition part of the if |part of the if command |command. |