Current wine implementation of SHFileOperation FO_MOVE don't allow wildcard move operations involving more then 1 file unless the move operation also involve a folder. This patch allow wildcard move operations to work also in this case
Fix Wine bug:https://bugs.winehq.org/show_bug.cgi?id=39269
Signed-off-by: Lorenzo Ferrillo lorenzofersteam@live.it --- dlls/shell32/shlfileop.c | 2 +- dlls/shell32/tests/shlfileop.c | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/dlls/shell32/shlfileop.c b/dlls/shell32/shlfileop.c index b941db3914..ab8454a357 100644 --- a/dlls/shell32/shlfileop.c +++ b/dlls/shell32/shlfileop.c @@ -1424,7 +1424,7 @@ static int move_files(LPSHFILEOPSTRUCTW lpFileOp, const FILE_LIST *flFrom, const }
if (!(lpFileOp->fFlags & FOF_MULTIDESTFILES) && - !flFrom->bAnyDirectories && + !flFrom->bAnyDirectories && !flFrom->bAnyFromWildcard && flFrom->dwNumFiles > flTo->dwNumFiles) { return ERROR_CANCELLED; diff --git a/dlls/shell32/tests/shlfileop.c b/dlls/shell32/tests/shlfileop.c index ca7876c846..31da9727cd 100644 --- a/dlls/shell32/tests/shlfileop.c +++ b/dlls/shell32/tests/shlfileop.c @@ -2743,13 +2743,13 @@ static void test_move_wildchar(void) set_curr_dir_path(from, "testdir2\*.*\0"); set_curr_dir_path(to, "test4.txt\0"); retval = SHFileOperationA(&shfo); - todo_wine ok(retval == ERROR_SUCCESS, "SHFileOperation failed\n"); - todo_wine ok(!shfo.fAnyOperationsAborted, "fAnyOperationsAborted %d\n", shfo.fAnyOperationsAborted); + ok(retval == ERROR_SUCCESS, "SHFileOperation failed\n"); + ok(!shfo.fAnyOperationsAborted, "fAnyOperationsAborted %d\n", shfo.fAnyOperationsAborted); ok(file_exists("testdir2"), "dir should not be moved\n"); - todo_wine ok(!file_exists("testdir2\one.txt"), "file should be moved\n"); - todo_wine ok(!file_exists("testdir2\two.txt"), "file should be moved\n"); - todo_wine ok(file_exists("test4.txt\one.txt"), "file should be moved here\n"); - todo_wine ok(file_exists("test4.txt\two.txt"), "file should be moved here\n"); + ok(!file_exists("testdir2\one.txt"), "file should be moved\n"); + ok(!file_exists("testdir2\two.txt"), "file should be moved\n"); + ok(file_exists("test4.txt\one.txt"), "file should be moved here\n"); + ok(file_exists("test4.txt\two.txt"), "file should be moved here\n");
DeleteFileA("test4.txt\one.txt"); DeleteFileA("test4.txt\two.txt");