mirror of
https://github.com/winscp/winscp.git
synced 2026-10-24 02:28:55 +03:00
Restoring consistent behavior of failing, between duplicating and moving/renaming files over existing file with WebDAV protocol in scripting and .NET assembly
The discrepancy was introduced by Bug 2120 cb021fe3.
This restores the mv/MoveFile behavior to fail, if the target file exists with WebDAV protocol (but still allows overwrite in the GUI).
The cp/DuplicateFile behavior is unchanged, but the internal API was modified to match that of mv/MoveFile, in anticipation of aligning move/duplicate command behavior in GUI and need to keep current scripting/.NET behavior.
Source commit: 4661a3ea7ec8123231e376aae9913ce8457750dd
This commit is contained in:
@@ -1356,21 +1356,21 @@ void __fastcall TS3FileSystem::DeleteFile(const UnicodeString AFileName,
|
||||
}
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void __fastcall TS3FileSystem::RenameFile(const UnicodeString FileName, const TRemoteFile * File,
|
||||
const UnicodeString NewName)
|
||||
void __fastcall TS3FileSystem::RenameFile(
|
||||
const UnicodeString & FileName, const TRemoteFile * File, const UnicodeString & NewName, bool Overwrite)
|
||||
{
|
||||
if (DebugAlwaysTrue(File != NULL) && File->IsDirectory)
|
||||
{
|
||||
throw Exception(LoadStr(NOTSUPPORTED));
|
||||
}
|
||||
CopyFile(FileName, File, NewName);
|
||||
CopyFile(FileName, File, NewName, Overwrite);
|
||||
TRmSessionAction DummyAction(FTerminal->ActionLog, FileName);
|
||||
DeleteFile(FileName, File, dfForceDelete, DummyAction);
|
||||
DummyAction.Cancel();
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void __fastcall TS3FileSystem::CopyFile(const UnicodeString AFileName, const TRemoteFile * File,
|
||||
const UnicodeString ANewName)
|
||||
void __fastcall TS3FileSystem::CopyFile(
|
||||
const UnicodeString & AFileName, const TRemoteFile * File, const UnicodeString & ANewName, bool DebugUsedArg(Overwrite))
|
||||
{
|
||||
if (DebugAlwaysTrue(File != NULL) && File->IsDirectory)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user