https://bugs.winehq.org/show_bug.cgi?id=37195
Bug ID: 37195 Summary: windows cmd does not accept wild cards when used in Wine Product: Wine-gecko Version: unspecified Hardware: x86 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: wine-gecko-unknown Assignee: jacek@codeweavers.com Reporter: jj.wauters@hotmail.com
Created attachment 49444 --> https://bugs.winehq.org/attachment.cgi?id=49444 batch example
Running a batch file where wild cards are used does not succeed as wild cards are not recognized.
Example with attached batch:
when running in Windows it shows the files when running in Wine it does not shows the files
https://bugs.winehq.org/show_bug.cgi?id=37195
Nikolay Sivov bunglehead@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Component|wine-gecko-unknown |-unknown Assignee|jacek@codeweavers.com |wine-bugs@winehq.org Product|Wine-gecko |Wine
https://bugs.winehq.org/show_bug.cgi?id=37195
Jason Edmeades us@edmeades.me.uk changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |us@edmeades.me.uk Component|-unknown |cmd
https://bugs.winehq.org/show_bug.cgi?id=37195
Ken Sharp imwellcushtymelike@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |download, source, testcase
--- Comment #1 from Ken Sharp imwellcushtymelike@gmail.com --- What version of Wine? Requires console logs. http://wiki.winehq.org/Bugs
https://bugs.winehq.org/show_bug.cgi?id=37195
Ken Sharp imwellcushtymelike@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Summary|windows cmd does not accept |cmd does not accept wild |wild cards when used in |cards |Wine |
https://bugs.winehq.org/show_bug.cgi?id=37195
--- Comment #2 from Jason Edmeades us@edmeades.me.uk --- All releases... no need for logs, as the sample batch pgm shows the issue.
The issue is simply in programs/cmd/builtins.c, WCMD_if, these lines:
else if (!lstrcmpiW (condition, existW)) { test = (GetFileAttributesW(WCMD_parameter(p, 1+negate, NULL, FALSE, FALSE)) != INVALID_FILE_ATTRIBUTES); WCMD_parameter(p, 2+negate, &command, FALSE, FALSE); }
so we take the parameter to the 'if' and type to find out about it. We probably should do something like (not even compiled!!)
else if (!lstrcmpiW (condition, existW)) { WIN32_FIND_DATAW fd; HANDLE hff; hff = FindFirstFileW(WCMD_parameter(p, 1+negate, NULL, FALSE, FALSE), &fd); test = (hff != INVALID_HANDLE_VALUE) FindClose(hff); WCMD_parameter(p, 2+negate, &command, FALSE, FALSE); }
Feel free to add a test, try this and submit - I dont have Linux to play with at the moment but the problem looks 'obvious'.
https://bugs.winehq.org/show_bug.cgi?id=37195
super_man@post.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |super_man@post.com
https://bugs.winehq.org/show_bug.cgi?id=37195
winetest@luukku.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |crramirez@gmail.com, | |winetest@luukku.com
https://bugs.winehq.org/show_bug.cgi?id=37195
--- Comment #3 from winetest@luukku.com --- You just need to add ;
test = (hff != INVALID_HANDLE_VALUE) <-- here.
And it compiles.
Still valid wine 1.9.24.
https://bugs.winehq.org/show_bug.cgi?id=37195
winetest@luukku.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |00cpxxx@gmail.com, | |austinenglish@gmail.com
--- Comment #4 from winetest@luukku.com --- I just retested this, because I understood that I need to replace the code and not add it there.
When done this correctly the patch indeed fixes the issue.
Now this bug needs test(s)? And submiter?
The keyword lacks patch word.
https://bugs.winehq.org/show_bug.cgi?id=37195
Jason Edmeades us@edmeades.me.uk changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution|--- |DUPLICATE
--- Comment #5 from Jason Edmeades us@edmeades.me.uk --- I'd forgotten about this... In effect its dup of bug#45052 which I have just submitted a patch for - ie the IF exists did not support wilcards previously (normally I'd resolve the newer bug dup of the older, but the other is the one I've submitted the patch against).
Interestingly the final patch was pretty much identical to the code I'd pasted in here, and I coded it a second time without looking :-)
*** This bug has been marked as a duplicate of bug 45052 ***
https://bugs.winehq.org/show_bug.cgi?id=37195
André H. nerv@dawncrow.de changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED CC| |nerv@dawncrow.de
--- Comment #6 from André H. nerv@dawncrow.de --- closing dup