https://bugs.winehq.org/show_bug.cgi?id=46816
Bug ID: 46816 Summary: Incorrect behavior of SHFileOperation Product: Wine Version: 4.0 Hardware: x86 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: shell32 Assignee: wine-bugs@winehq.org Reporter: rndltrz@hotmail.com Distribution: ---
Behavior of SHFileOperation differs from windows.
Here is some trivial code that copies a directory:
const wchar_t *const sourceDir = L"C:\TestDir\0\0"; const wchar_t *const destDir = L"C:\TestDir2\0\0"; SHFILEOPSTRUCTW do_copy = { 0 }; do_copy.wFunc = FO_COPY; do_copy.fFlags = FOF_NOCONFIRMMKDIR | FOF_NOCONFIRMATION | FOF_NO_UI; do_copy.pFrom = sourceDir; do_copy.pTo = destDir; SHFileOperationW(&do_copy);
If you add trailing backslash to destDir:
const wchar_t *const destDir = L"C:\TestDir2\\0\0";
On Windows result would be the same. However, on WINE+linux result would be different:
no backslashes:
$ls TestDir file.txt Subdir1 Subdir2 $ls TestDir2 file.txt Subdir1 Subdir2
with trailing backslash:
$ls TestDir file.txt Subdir1 Subdir2 $ls TestDir2 TestDir
This causes issues with programs that rely on Windows behavior.