From 1abe56733fc4d5dfe9b7264c12508314cab3cbfe Mon Sep 17 00:00:00 2001 From: troth Date: Thu, 28 Aug 2003 05:37:57 +0000 Subject: [PATCH] * main.c (update_progress_no_tty): Properly terminate progress. Also fixes stk500 problem where number of bytes written is less than a page. git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@348 81a1dc3b-b13d-400b-aceb-764788c761c2 --- ChangeLog | 5 +++++ main.c | 7 +++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index cc8837ce..00d6f916 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2003-08-27 Theodore A. Roth + + * main.c (update_progress_no_tty): Properly terminate progress. Also + fixes stk500 problem where number of bytes written is less than a page. + 2003-08-27 Theodore A. Roth * avrdude.spec.in: Fix broken rpmbuild on RedHat-9. diff --git a/main.c b/main.c index d85e8971..a02e515e 100644 --- a/main.c +++ b/main.c @@ -363,23 +363,26 @@ static void update_progress_tty (int percent, double etime, char *hdr) static void update_progress_no_tty (int percent, double etime, char *hdr) { + static int done = 0; static int last = 0; int cnt = (percent>>1)*2; if (hdr) { fprintf (stderr, "\n%s | ", hdr); last = 0; + done = 0; } else { - while (cnt > last) { + while ((cnt > last) && (done == 0)) { fprintf (stderr, "#"); cnt -= 2; } } - if ((percent == 100) && (last != 0)) { + if ((percent == 100) && (done == 0)) { fprintf (stderr, " | 100%% %0.2fs\n\n", etime); last = 0; + done = 1; } else last = (percent>>1)*2; /* Make last a multiple of 2. */