[Bug 44369] New: cmd's %0 path variables (e.g. %~dp0) wrong inside subroutine call
https://bugs.winehq.org/show_bug.cgi?id=44369 Bug ID: 44369 Summary: cmd's %0 path variables (e.g. %~dp0) wrong inside subroutine call Product: Wine Version: 3.0-rc6 Hardware: x86 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: cmd Assignee: wine-bugs(a)winehq.org Reporter: ryan.prichard(a)gmail.com Distribution: --- Test program (C:\bin\workaround.cmd): @echo off call :fix exit /b :fix echo [%0] [%~d0] [%~p0] [%~n0] [%~x0] exit /b Expected behavior (tested on XP): C:\>set PATH=C:\bin;%PATH% C:\>workaround.cmd [:fix] [C:] [\bin\] [workaround] [.cmd] C:\>"workaround.cmd" [:fix] [C:] [\bin\] [workaround] [.cmd] C:\>"w"or"k"aroun"d.c"md [:fix] [C:] [\bin\] [workaround] [.cmd] Behavior on wine-3.0-rc6: c:\>set PATH=C:\bin;%PATH% c:\>workaround.cmd [:fix] [c:] [\] [:fix] [] c:\>"workaround.cmd" [:fix] [c:] [\] [:fix] [] c:\>"w"or"k"aroun"d.c"md [:fix] [c:] [\] [:fix] [] Background: The Android NDK generates wrapper batch files that invoke clang.exe. If the wrapper is invoked from the PATH using double-quotes, then %~dp0 is wrong (when using Windows CMD). A workaround I've found is to evaluate %~dp0 in a subroutine in the batch file. This workaround works with Windows CMD, but breaks with Wine CMD. (It expands to the working directory instead.) See https://github.com/android-ndk/ndk/issues/616#issuecomment-358117090. FWIW: Wine CMD doesn't have the same %~dp0 bugginess as Windows CMD that motivated the GitHub issue I linked to. Wine handles all of the example command lines on that GitHub comment consistently (aside from case differences in the drive letter or the filename extension). If Wine tries to match Windows bug-for-bug, then maybe this too should change. -- 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.
https://bugs.winehq.org/show_bug.cgi?id=44369 Fabian Maurer <dark.shadow4(a)web.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |testcase Ever confirmed|0 |1 Status|UNCONFIRMED |NEW CC| |dark.shadow4(a)web.de --- Comment #1 from Fabian Maurer <dark.shadow4(a)web.de> --- Confirming issue.
FWIW: Wine CMD doesn't have the same %~dp0 bugginess as Windows CMD that motivated the GitHub issue I linked to. Wine handles all of the example command lines on that GitHub comment consistently (aside from case differences in the drive letter or the filename extension). If Wine tries to match Windows bug-for-bug, then maybe this too should change.
Yeah, I guess that should change, too. Mind creating a bug report for that one, too? Including a small sample would be awesome. -- 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.
https://bugs.winehq.org/show_bug.cgi?id=44369 --- Comment #2 from Ryan Prichard <ryan.prichard(a)gmail.com> --- Ok, I filed https://bugs.winehq.org/show_bug.cgi?id=44373 for the Wine-vs-Windows differences in %0 path variables w.r.t. quoting and case-canonicalization. -- 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.
https://bugs.winehq.org/show_bug.cgi?id=44369 Jason Edmeades <us(a)edmeades.me.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|wine-bugs(a)winehq.org |us(a)edmeades.me.uk CC| |us(a)edmeades.me.uk -- 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.
https://bugs.winehq.org/show_bug.cgi?id=44369 --- Comment #3 from Jason Edmeades <us(a)edmeades.me.uk> --- https://www.winehq.org/pipermail/wine-devel/2018-August/130220.html -- 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.
https://bugs.winehq.org/show_bug.cgi?id=44369 Jason Edmeades <us(a)edmeades.me.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Fixed by SHA1| |987fee3791d24a63aacc0b49f59 | |275b62c943815 Resolution|--- |FIXED --- Comment #4 from Jason Edmeades <us(a)edmeades.me.uk> --- Committed -- 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.
https://bugs.winehq.org/show_bug.cgi?id=44369 Alexandre Julliard <julliard(a)winehq.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED --- Comment #5 from Alexandre Julliard <julliard(a)winehq.org> --- Closing bugs fixed in 3.15. -- 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.
https://bugs.winehq.org/show_bug.cgi?id=44369 Michael Stefaniuc <mstefani(a)winehq.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|--- |3.0.x -- 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.
https://bugs.winehq.org/show_bug.cgi?id=44369 Michael Stefaniuc <mstefani(a)winehq.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|3.0.x |--- --- Comment #6 from Michael Stefaniuc <mstefani(a)winehq.org> --- Removing the 3.0.x milestone from bug fixes included in 3.0.4. -- 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.
participants (1)
-
wine-bugs@winehq.org