static void *
dot_create (long initial, long total)
{
- struct dot_progress *dp = xmalloc (sizeof (struct dot_progress));
-
- memset (dp, 0, sizeof (*dp));
-
+ struct dot_progress *dp = xnew0 (struct dot_progress);
dp->initial_length = initial;
dp->total_length = total;
static void *
bar_create (long initial, long total)
{
- struct bar_progress *bp = xmalloc (sizeof (struct bar_progress));
-
- memset (bp, 0, sizeof (*bp));
+ struct bar_progress *bp = xnew0 (struct bar_progress);
/* In theory, our callers should take care of this pathological
case, but it can sometimes happen. */
else
APPEND_LITERAL (" ");
- /* The progress bar: "[====> ]" or "[--==> ]". */
+ /* The progress bar: "[====> ]" or "[++==> ]". */
if (progress_size && bp->total_length > 0)
{
/* Size of the initial portion. */
*p++ = '[';
begin = p;
- /* Print the initial portion of the download with '-' chars, the
+ /* Print the initial portion of the download with '+' chars, the
rest with '=' and one '>'. */
for (i = 0; i < insz; i++)
- *p++ = '-';
+ *p++ = '+';
dlsz -= insz;
if (dlsz > 0)
{
/* Don't change the value of ETA more than approximately once
per second; doing so would cause flashing without providing
any value to the user. */
- if (dl_total_time - bp->last_eta_time < 900
- && bp->last_eta_value != 0)
+ if (bp->total_length != size
+ && bp->last_eta_value != 0
+ && dl_total_time - bp->last_eta_time < 900)
eta = bp->last_eta_value;
else
{