Browse Source

Failure when moving files using FTP, caused by fbf8bdb1

Source commit: c09ff9ada6a917a59b00a79ad9f5d1f0d27bdf62
Martin Prikryl 2 years ago
parent
commit
e6f16c13f9
1 changed files with 13 additions and 7 deletions
  1. 13 7
      source/core/Terminal.cpp

+ 13 - 7
source/core/Terminal.cpp

@@ -4924,17 +4924,23 @@ bool TTerminal::DoRenameOrCopyFile(
     try
     {
       TCustomFileSystem * FileSystem;
-      if (!Rename &&
-          IsCapable[fcSecondaryShell] &&
-          File->IsDirectory &&
-          (FCommandSession != NULL)) // Won't be in scripting, there we let it fail later
+      if (!Rename)
       {
-        PrepareCommandSession();
-        FileSystem = FCommandSession->FFileSystem;
+        if (IsCapable[fcSecondaryShell] &&
+            File->IsDirectory &&
+            (FCommandSession != NULL)) // Won't be in scripting, there we let it fail later
+        {
+          PrepareCommandSession();
+          FileSystem = FCommandSession->FFileSystem;
+        }
+        else
+        {
+          FileSystem = GetFileSystemForCapability(fcRemoteCopy);
+        }
       }
       else
       {
-        FileSystem = GetFileSystemForCapability(fcRemoteCopy);
+        FileSystem = FFileSystem;
       }
 
       if (!IsCapable[fcMoveOverExistingFile] && !DontOverwrite)