version 1.4, 2003/07/17 12:06:18 |
version 1.5, 2004/03/09 17:04:24 |
Line 52 __RCSID("$NetBSD$"); |
|
Line 52 __RCSID("$NetBSD$"); |
|
#include <signal.h> |
#include <signal.h> |
#include <stdio.h> |
#include <stdio.h> |
#include <stdlib.h> |
#include <stdlib.h> |
|
#include <string.h> |
#include <time.h> |
#include <time.h> |
#include <tzfile.h> |
#include <tzfile.h> |
#include <unistd.h> |
#include <unistd.h> |
Line 200 progressmeter(int flag) |
|
Line 201 progressmeter(int flag) |
|
return; |
return; |
|
|
len += snprintf(buf + len, BUFLEFT, "\r"); |
len += snprintf(buf + len, BUFLEFT, "\r"); |
|
if (prefix) |
|
len += snprintf(buf + len, BUFLEFT, "%s", prefix); |
if (filesize > 0) { |
if (filesize > 0) { |
ratio = (int)((double)cursize * 100.0 / (double)filesize); |
ratio = (int)((double)cursize * 100.0 / (double)filesize); |
ratio = MAX(ratio, 0); |
ratio = MAX(ratio, 0); |
Line 211 progressmeter(int flag) |
|
Line 214 progressmeter(int flag) |
|
* the number of stars won't exceed the buffer size |
* the number of stars won't exceed the buffer size |
*/ |
*/ |
barlength = MIN(sizeof(buf) - 1, ttywidth) - BAROVERHEAD; |
barlength = MIN(sizeof(buf) - 1, ttywidth) - BAROVERHEAD; |
|
if (prefix) |
|
barlength -= strlen(prefix); |
if (barlength > 0) { |
if (barlength > 0) { |
i = barlength * ratio / 100; |
i = barlength * ratio / 100; |
len += snprintf(buf + len, BUFLEFT, |
len += snprintf(buf + len, BUFLEFT, |