[Bug 51869] New: ReplaceFileW/A does not work with Unix-style paths
WineHQ Bugzilla
wine-bugs at winehq.org
Tue Oct 12 02:00:33 CDT 2021
https://bugs.winehq.org/show_bug.cgi?id=51869
Bug ID: 51869
Summary: ReplaceFileW/A does not work with Unix-style paths
Product: Wine
Version: 6.0.1
Hardware: x86-64
OS: Linux
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: kernel32
Assignee: wine-bugs at winehq.org
Reporter: quyse0 at gmail.com
Distribution: ---
Created attachment 70784
--> https://bugs.winehq.org/attachment.cgi?id=70784
Test log
It seems ReplaceFile function does not handle Unix-style paths correctly. I
tested calls like:
ReplaceFileW(L"abc/def/12.txt", L"abc/def/34.txt", NULL, 0, NULL, NULL));
ReplaceFileW(L"abc\\def\\56.txt", L"abc\\def\\78.txt", NULL, 0, NULL, NULL));
Under Wine, first call fails, second one succeeds. The relevant part of
WINEDEBUG=+all log is in the attachment. On Windows, both calls succeed.
I attempted to look at Wine code, and it seems the problem is that ReplaceFileW
implementation tries to get directory name of replaced file using
PathRemoveFileSpecW, which only handles backslashes. On Windows,
PathRemoveFileSpecW also works with backslashes only, but ReplaceFileW still
works correctly with Unix-style paths.
For context, I am trying to run a proprietary compiler toolchain under Wine,
and my script passes Unix-style paths to it, which is I believe a common
practice for cross-platform build scripts. The same script works fine on
Windows, but fails under Wine.
I mostly use Wine stable (6.0.1), but tested that Wine 6.19 has the same
behavior.
--
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.
More information about the wine-bugs
mailing list