My previous patch introduces a cosmetic problem when there are no packages
to install.

Calling ThreeBarProgressPage::SetBar2(0, 0) indicates we are -2147483648%
done, while we iterate over all packages looking for packages to md5sum.

So avoid calling SetBar2() in that case.

2011-07-21  Jon TURNEY  <[email protected]>

        * install.cc (do_install_thread): Fix cosmetic problem when
        there are no packages to install.

Signed-off-by: Jon TURNEY <[email protected]>
---
 install.cc |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/install.cc b/install.cc
index 9f13d7b..882c0e5 100644
--- a/install.cc
+++ b/install.cc
@@ -700,7 +700,8 @@ do_install_thread (HINSTANCE h, HWND owner)
       uninstall_q.push_back (&pkg);
     }
 
-    Progress.SetBar2 (md5sum_total_bytes_sofar, md5sum_total_bytes);
+    if (md5sum_total_bytes > 0)
+      Progress.SetBar2 (md5sum_total_bytes_sofar, md5sum_total_bytes);
   }
 
   /* start with uninstalls - remove files that new packages may replace */
-- 
1.7.5.1

Reply via email to