mirror of
git://source.winehq.org/git/wine.git
synced 2024-09-01 03:33:38 +00:00
cmd: Make RENAME work for read-only files.
This commit is contained in:
parent
d5523fcd80
commit
6fd9d77426
|
@ -1768,8 +1768,8 @@ void WCMD_remove_dir (WCHAR *command) {
|
|||
* Rename a file.
|
||||
*/
|
||||
|
||||
void WCMD_rename (void) {
|
||||
|
||||
void WCMD_rename (void)
|
||||
{
|
||||
int status;
|
||||
HANDLE hff;
|
||||
WIN32_FIND_DATAW fd;
|
||||
|
@ -1779,7 +1779,6 @@ void WCMD_rename (void) {
|
|||
WCHAR dir[MAX_PATH];
|
||||
WCHAR fname[MAX_PATH];
|
||||
WCHAR ext[MAX_PATH];
|
||||
DWORD attribs;
|
||||
|
||||
errorlevel = 0;
|
||||
|
||||
|
@ -1853,15 +1852,7 @@ void WCMD_rename (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 {
|
||||
status = MoveFileW(src, dest);
|
||||
}
|
||||
status = MoveFileW(src, dest);
|
||||
|
||||
if (!status) {
|
||||
WCMD_print_error ();
|
||||
|
|
|
@ -602,7 +602,7 @@ bar renamed to foo
|
|||
foo
|
||||
bar
|
||||
... rename read-only files ...
|
||||
@todo_wine@read-only file renamed
|
||||
read-only file renamed
|
||||
... rename directories ...
|
||||
dir renamed
|
||||
read-only dir renamed
|
||||
|
|
Loading…
Reference in a new issue