version 1.12, 1999/10/05 12:17:05 |
version 1.13, 1999/10/08 01:25:20 |
|
|
lastsize = 0; |
lastsize = 0; |
} |
} |
(void)gettimeofday(&now, (struct timezone *)0); |
(void)gettimeofday(&now, (struct timezone *)0); |
if (totalbytes <= 0) |
|
return; |
|
cursize = statbytes; |
cursize = statbytes; |
ratio = cursize * 100 / totalbytes; |
if (totalbytes != 0) { |
ratio = MAX(ratio, 0); |
ratio = cursize * 100 / totalbytes; |
ratio = MIN(ratio, 100); |
ratio = MAX(ratio, 0); |
|
ratio = MIN(ratio, 100); |
|
} |
|
else |
|
ratio = 100; |
|
|
snprintf(buf, sizeof(buf), "\r%-20.20s %3d%% ", curfile, ratio); |
snprintf(buf, sizeof(buf), "\r%-20.20s %3d%% ", curfile, ratio); |
|
|
barlength = getttywidth() - 51; |
barlength = getttywidth() - 51; |