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
1e4c17e5
Commit
1e4c17e5
authored
Oct 13, 2011
by
Frédéric Delanoy
Committed by
Alexandre Julliard
Oct 13, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cmd: Make MOVE work for read-only files.
parent
ad9ae2b8
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
13 deletions
+4
-13
builtins.c
programs/cmd/builtins.c
+3
-12
test_builtins.cmd.exp
programs/cmd/tests/test_builtins.cmd.exp
+1
-1
No files found.
programs/cmd/builtins.c
View file @
1e4c17e5
...
...
@@ -1554,8 +1554,8 @@ void WCMD_if (WCHAR *p, CMD_LIST **cmdList) {
* Move a file, directory tree or wildcarded set of files.
*/
void
WCMD_move
(
void
)
{
void
WCMD_move
(
void
)
{
int
status
;
WIN32_FIND_DATAW
fd
;
HANDLE
hff
;
...
...
@@ -1594,6 +1594,7 @@ void WCMD_move (void) {
WCHAR
dest
[
MAX_PATH
];
WCHAR
src
[
MAX_PATH
];
DWORD
attribs
;
BOOL
ok
=
TRUE
;
WINE_TRACE
(
"Processing file '%s'
\n
"
,
wine_dbgstr_w
(
fd
.
cFileName
));
...
...
@@ -1617,15 +1618,6 @@ void WCMD_move (void) {
WINE_TRACE
(
"Source '%s'
\n
"
,
wine_dbgstr_w
(
src
));
WINE_TRACE
(
"Dest '%s'
\n
"
,
wine_dbgstr_w
(
dest
));
/* Check if file is read only, otherwise move it */
attribs
=
GetFileAttributesW
(
src
);
if
((
attribs
!=
INVALID_FILE_ATTRIBUTES
)
&&
(
attribs
&
FILE_ATTRIBUTE_READONLY
))
{
SetLastError
(
ERROR_ACCESS_DENIED
);
status
=
0
;
}
else
{
BOOL
ok
=
TRUE
;
/* If destination exists, prompt unless /Y supplied */
if
(
GetFileAttributesW
(
dest
)
!=
INVALID_FILE_ATTRIBUTES
)
{
BOOL
force
=
FALSE
;
...
...
@@ -1671,7 +1663,6 @@ void WCMD_move (void) {
}
else
{
status
=
1
;
/* Anything other than 0 to prevent error msg below */
}
}
if
(
!
status
)
{
WCMD_print_error
();
...
...
programs/cmd/tests/test_builtins.cmd.exp
View file @
1e4c17e5
...
...
@@ -609,7 +609,7 @@ bar
file move succeeded
@todo_wine@file move with overwrite succeeded@or_broken@file overwrite impossible!
@todo_wine@bar@or_broken@baz
@todo_wine@
read-only files are moveable
read-only files are moveable
file moved in subdirectory
@todo_wine@moving a file to itself is a no-op@or_broken@moving a file to itself should be a no-op!
@todo_wine@ErrorLevel: 0@or_broken@ErrorLevel: 1
...
...
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