Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
b609e252
Commit
b609e252
authored
Feb 01, 2010
by
Vincent Povirk
Committed by
Alexandre Julliard
Feb 08, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shell32: Use the current directory when copying to an empty destination.
parent
71e4af50
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
0 deletions
+26
-0
shlfileop.c
dlls/shell32/shlfileop.c
+14
-0
shlfileop.c
dlls/shell32/tests/shlfileop.c
+12
-0
No files found.
dlls/shell32/shlfileop.c
View file @
b609e252
...
...
@@ -1182,6 +1182,20 @@ static HRESULT copy_files(FILE_OPERATION *op, const FILE_LIST *flFrom, FILE_LIST
if
(
flFrom
->
bAnyDontExist
)
return
ERROR_SHELL_INTERNAL_FILE_NOT_FOUND
;
if
(
flTo
->
dwNumFiles
==
0
)
{
/* If the destination is empty, SHFileOperation should use the current directory */
WCHAR
curdir
[
MAX_PATH
+
1
];
GetCurrentDirectoryW
(
MAX_PATH
,
curdir
);
curdir
[
lstrlenW
(
curdir
)
+
1
]
=
0
;
destroy_file_list
(
flTo
);
ZeroMemory
(
flTo
,
sizeof
(
FILE_LIST
));
parse_file_list
(
flTo
,
curdir
);
fileDest
=
&
flTo
->
feFiles
[
0
];
}
if
(
op
->
req
->
fFlags
&
FOF_MULTIDESTFILES
)
{
if
(
flFrom
->
bAnyFromWildcard
)
...
...
dlls/shell32/tests/shlfileop.c
View file @
b609e252
...
...
@@ -1720,6 +1720,18 @@ static void test_copy(void)
ok
(
DeleteFileA
(
"ab.txt"
),
"Expected file to exist
\n
"
);
ok
(
RemoveDirectoryA
(
"one"
),
"Expected dir to exist
\n
"
);
ok
(
RemoveDirectoryA
(
"two"
),
"Expected dir to exist
\n
"
);
/* pTo is an empty string */
CreateDirectoryA
(
"dir"
,
NULL
);
createTestFile
(
"dir
\\
abcdefgh.abc"
);
shfo
.
pFrom
=
"dir
\\
abcdefgh.abc
\0
"
;
shfo
.
pTo
=
"
\0
"
;
shfo
.
fFlags
=
FOF_NOCONFIRMATION
|
FOF_SILENT
|
FOF_NOERRORUI
;
retval
=
SHFileOperation
(
&
shfo
);
ok
(
retval
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
retval
);
ok
(
DeleteFileA
(
"dir
\\
abcdefgh.abc"
),
"Expected file to exist
\n
"
);
ok
(
DeleteFileA
(
"abcdefgh.abc"
),
"Expected file to exist
\n
"
);
ok
(
RemoveDirectoryA
(
"dir"
),
"Expected dir to exist
\n
"
);
}
/* tests the FO_MOVE action */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment