secremain = (maxb - b) / bpsec;
minremain = (secremain / 60) % 60;
hremain = secremain / 3600;
- len = printf("Remainining: %ld files. ", maxb-b);
+ len = printf("Remaining: %ld files. ", maxb-b);
#if 0
len += printf("ETA: %d:%02d:%02d ",
printf("|");
for(; i < len-2; i++)
printf("-");
- printf("]\n");
+ printf("]\e[K\n");
} else printf("\n");
return;
for(l = 1; l <= LINES+1; l++) printf("\n");
printf("\e[A");
while(fgets(line, sizeof(line), stdin)) {
+ char *nl;
i++;
for(l = 0; l <= LINES; l++) printf("\e[A");
if(i <= count) prettyprogress(i, count, start);
else printf("\n");
printf("\e[M");
for(l = 0; l < LINES; l++) printf("\e[B");
- printf("\r%s\e[A", line);
+ if((nl = strchr(line, '\n'))) *nl = '\0';
+ line[78] = '\0';
+ printf("\r%s\r", line);
}
printf("\nDone.\e[K\n");