Browse Source

Bug 1808: Failure when synchronizing directories after they were previously synchronized while being empty

https://winscp.net/tracker/1808

Source commit: ecde3a9fce036ed9e76c25adf82fcb51f8739871
Martin Prikryl 6 years ago
parent
commit
a0190e30c5
1 changed files with 1 additions and 1 deletions
  1. 1 1
      source/forms/SynchronizeProgress.cpp

+ 1 - 1
source/forms/SynchronizeProgress.cpp

@@ -105,7 +105,7 @@ int __fastcall TSynchronizeProgressForm::SetData(
 //---------------------------------------------------------------------------
 int __fastcall TSynchronizeProgressForm::CalculateProgress()
 {
-  return ((OperationProgress->Style == pbstMarquee) ? -1 : ((OperationProgress->Position * 100) / OperationProgress->Max));
+  return (((OperationProgress->Style == pbstMarquee) || (OperationProgress->Max == 0)) ? -1 : ((OperationProgress->Position * 100) / OperationProgress->Max));
 }
 //---------------------------------------------------------------------------
 void __fastcall TSynchronizeProgressForm::UpdateControls()