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
da8a801a
Commit
da8a801a
authored
May 08, 2018
by
Daniel Lehman
Committed by
Alexandre Julliard
May 09, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shell32: Convert / to \ when parsing file list.
Signed-off-by:
Daniel Lehman
<
dlehman25@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
351c8621
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
49 additions
and
0 deletions
+49
-0
shlfileop.c
dlls/shell32/shlfileop.c
+3
-0
shlfileop.c
dlls/shell32/tests/shlfileop.c
+46
-0
No files found.
dlls/shell32/shlfileop.c
View file @
da8a801a
...
...
@@ -1005,6 +1005,7 @@ static HRESULT parse_file_list(FILE_LIST *flList, LPCWSTR szFiles)
{
LPCWSTR
ptr
=
szFiles
;
WCHAR
szCurFile
[
MAX_PATH
];
WCHAR
*
p
;
DWORD
i
=
0
;
if
(
!
szFiles
)
...
...
@@ -1039,6 +1040,8 @@ static HRESULT parse_file_list(FILE_LIST *flList, LPCWSTR szFiles)
flList
->
feFiles
[
i
].
bFromRelative
=
FALSE
;
}
for
(
p
=
szCurFile
;
*
p
;
p
++
)
if
(
*
p
==
'/'
)
*
p
=
'\\'
;
/* parse wildcard files if they are in the filename */
if
(
StrPBrkW
(
szCurFile
,
wWildcardChars
))
{
...
...
dlls/shell32/tests/shlfileop.c
View file @
da8a801a
...
...
@@ -1869,6 +1869,28 @@ static void test_copy(void)
ok
(
retval
!=
ERROR_SUCCESS
,
"Unexpected ERROR_SUCCESS
\n
"
);
ok
(
!
shfo
.
fAnyOperationsAborted
,
"Didn't expect aborted operations
\n
"
);
ok
(
GetLastError
()
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
GetLastError
());
/* test with / */
CreateDirectoryA
(
"dir"
,
NULL
);
CreateDirectoryA
(
"dir
\\
subdir"
,
NULL
);
createTestFile
(
"dir
\\
subdir
\\
aa.txt"
);
shfo
.
pFrom
=
"dir/subdir/aa.txt
\0
"
;
shfo
.
pTo
=
"dir
\\
destdir/aa.txt
\0
"
;
shfo
.
fFlags
=
FOF_NOCONFIRMATION
|
FOF_NOCONFIRMMKDIR
|
FOF_SILENT
|
FOF_NOERRORUI
;
retval
=
SHFileOperationA
(
&
shfo
);
if
(
dir_exists
(
"dir
\\
destdir"
))
{
ok
(
retval
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
retval
);
ok
(
DeleteFileA
(
"dir
\\
destdir
\\
aa.txt"
),
"Expected file to exist
\n
"
);
ok
(
RemoveDirectoryA
(
"dir
\\
destdir"
),
"Expected dir to exist
\n
"
);
}
else
{
expect_retval
(
ERROR_CANCELLED
,
DE_OPCANCELLED
/* WinXp, Win2k */
);
}
ok
(
DeleteFileA
(
"dir
\\
subdir
\\
aa.txt"
),
"Expected file to exist
\n
"
);
ok
(
RemoveDirectoryA
(
"dir
\\
subdir"
),
"Expected dir to exist
\n
"
);
ok
(
RemoveDirectoryA
(
"dir"
),
"Expected dir to exist
\n
"
);
}
/* tests the FO_MOVE action */
...
...
@@ -1921,6 +1943,30 @@ static void test_move(void)
clean_after_shfo_tests
();
init_shfo_tests
();
/* same tests above, but with / */
set_curr_dir_path
(
from
,
"testdir2/*.*
\0
"
);
set_curr_dir_path
(
to
,
"test4.txt
\0
"
);
retval
=
SHFileOperationA
(
&
shfo
);
ok
(
retval
==
ERROR_SUCCESS
||
broken
(
retval
==
ERROR_FILE_NOT_FOUND
),
/* WinXp, Win2k3 */
"Expected ERROR_SUCCESS, got %d
\n
"
,
retval
);
if
(
retval
==
ERROR_SUCCESS
)
{
ok
(
!
shfo
.
fAnyOperationsAborted
,
"fAnyOperationsAborted %d
\n
"
,
shfo
.
fAnyOperationsAborted
);
ok
(
dir_exists
(
"testdir2"
),
"dir should not be moved
\n
"
);
ok
(
!
file_exists
(
"testdir2
\\
one.txt"
),
"file should be moved
\n
"
);
ok
(
!
dir_exists
(
"testdir2
\\
nested"
),
"dir should be moved
\n
"
);
ok
(
!
file_exists
(
"testdir2
\\
nested
\\
two.txt"
),
"file should be moved
\n
"
);
ok
(
file_exists
(
"test4.txt
\\
one.txt"
),
"file should exist
\n
"
);
ok
(
dir_exists
(
"test4.txt
\\
nested"
),
"dir should exist
\n
"
);
ok
(
file_exists
(
"test4.txt
\\
nested
\\
two.txt"
),
"file should exist
\n
"
);
}
clean_after_shfo_tests
();
init_shfo_tests
();
shfo
.
hwnd
=
NULL
;
shfo
.
wFunc
=
FO_MOVE
;
shfo
.
pFrom
=
from
;
...
...
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