- in progressmeter() perform the check for foregroundproc() a little earlier
- removed unused variable `items' in list_vertical()
This commit is contained in:
parent
3da9705446
commit
872f81b081
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: util.c,v 1.100 2000/08/06 08:51:22 lukem Exp $ */
|
||||
/* $NetBSD: util.c,v 1.101 2000/08/27 06:31:23 lukem Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1997-2000 The NetBSD Foundation, Inc.
|
||||
|
@ -75,7 +75,7 @@
|
|||
|
||||
#include <sys/cdefs.h>
|
||||
#ifndef lint
|
||||
__RCSID("$NetBSD: util.c,v 1.100 2000/08/06 08:51:22 lukem Exp $");
|
||||
__RCSID("$NetBSD: util.c,v 1.101 2000/08/27 06:31:23 lukem Exp $");
|
||||
#endif /* not lint */
|
||||
|
||||
/*
|
||||
|
@ -900,6 +900,12 @@ progressmeter(int flag)
|
|||
if (!progress || filesize <= 0)
|
||||
return;
|
||||
|
||||
/*
|
||||
* print progress bar only if we are foreground process.
|
||||
*/
|
||||
if (! foregroundproc())
|
||||
return;
|
||||
|
||||
(void)gettimeofday(&now, NULL);
|
||||
cursize = bytes + restart_point;
|
||||
timersub(&now, &lastupdate, &wait);
|
||||
|
@ -909,12 +915,6 @@ progressmeter(int flag)
|
|||
wait.tv_sec = 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* print progress bar only if we are foreground process.
|
||||
*/
|
||||
if (! foregroundproc())
|
||||
return;
|
||||
|
||||
ratio = (int)((double)cursize * 100.0 / (double)filesize);
|
||||
ratio = MAX(ratio, 0);
|
||||
ratio = MIN(ratio, 100);
|
||||
|
@ -1088,10 +1088,10 @@ void
|
|||
list_vertical(StringList *sl)
|
||||
{
|
||||
int i, j, w;
|
||||
int columns, width, lines, items;
|
||||
int columns, width, lines;
|
||||
char *p;
|
||||
|
||||
width = items = 0;
|
||||
width = 0;
|
||||
|
||||
for (i = 0 ; i < sl->sl_cur ; i++) {
|
||||
w = strlen(sl->sl_str[i]);
|
||||
|
|
Loading…
Reference in New Issue