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. */