Ver Fonte

Bug 1656: File mask is not considered when calculating total file transfer size when deleting original files

https://winscp.net/tracker/1656
(cherry picked from commit 6f766817ee627a31df8abe6e150f5a94df7c27e7)

Source commit: 6420e07f1e7e46620cc2a9388a54b421b6b98c96
Martin Prikryl há 7 anos atrás
pai
commit
49953cfdd1
1 ficheiros alterados com 2 adições e 10 exclusões
  1. 2 10
      source/core/Terminal.cpp

+ 2 - 10
source/core/Terminal.cpp

@@ -6506,12 +6506,8 @@ bool __fastcall TTerminal::CopyToRemote(TStrings * FilesToCopy,
       Files.reset(new TStringList());
       Files->OwnsObjects = true;
     }
-    // dirty trick: when moving, do not pass copy param to avoid exclude mask
     bool CalculatedSize =
-      CalculateLocalFilesSize(
-        FilesToCopy, Size,
-        (FLAGCLEAR(Params, cpDelete) ? CopyParam : NULL),
-        CopyParam->CalculateSize, Files.get());
+      CalculateLocalFilesSize(FilesToCopy, Size, CopyParam, CopyParam->CalculateSize, Files.get());
 
     FLastProgressLogged = GetTickCount();
     TFileOperationProgressType OperationProgress(&DoProgress, &DoFinished);
@@ -6956,13 +6952,9 @@ bool __fastcall TTerminal::CopyToLocal(TStrings * FilesToCopy,
     ExceptionOnFail = true;
     try
     {
-      // dirty trick: when moving, do not pass copy param to avoid exclude mask
       TCalculateSizeStats Stats;
       Stats.FoundFiles = Files.get();
-      if (CalculateFilesSize(
-           FilesToCopy, TotalSize, csIgnoreErrors,
-           (FLAGCLEAR(Params, cpDelete) ? CopyParam : NULL),
-           CopyParam->CalculateSize, Stats))
+      if (CalculateFilesSize(FilesToCopy, TotalSize, csIgnoreErrors, CopyParam, CopyParam->CalculateSize, Stats))
       {
         TotalSizeKnown = true;
       }