ソースを参照

Bug 1674: Wrong error message when attempting to rename an S3 folder

https://winscp.net/tracker/1674

Source commit: 92e1aaf78bbfcf90bd52a2ff71717937093e7d61
Martin Prikryl 7 年 前
コミット
44a6030586
1 ファイル変更4 行追加0 行削除
  1. 4 0
      source/core/S3FileSystem.cpp

+ 4 - 0
source/core/S3FileSystem.cpp

@@ -965,6 +965,10 @@ void __fastcall TS3FileSystem::DeleteFile(const UnicodeString AFileName,
 void __fastcall TS3FileSystem::RenameFile(const UnicodeString FileName, const TRemoteFile * File,
   const UnicodeString NewName)
 {
+  if (DebugAlwaysTrue(File != NULL) && File->IsDirectory)
+  {
+    throw Exception(LoadStr(NOTSUPPORTED));
+  }
   CopyFile(FileName, File, NewName);
   TRmSessionAction DummyAction(FTerminal->ActionLog, FileName);
   DeleteFile(FileName, File, dfForceDelete, DummyAction);