hexdump: Flush stdout after '*' (repeat) lines.

The canonical annoying example being:   hexdump < /dev/zero | less
This commit is contained in:
Poul-Henning Kamp 2021-07-29 06:37:39 +00:00
parent 7f8f79a5c4
commit 272144ab41

View file

@ -274,8 +274,10 @@ get(void)
if (vflag != ALL &&
valid_save &&
bcmp(curp, savp, nread) == 0) {
if (vflag != DUP)
if (vflag != DUP) {
(void)printf("*\n");
(void)fflush(stdout);
}
return((u_char *)NULL);
}
bzero((char *)curp + nread, need);
@ -305,8 +307,10 @@ get(void)
vflag = WAIT;
return(curp);
}
if (vflag == WAIT)
if (vflag == WAIT) {
(void)printf("*\n");
(void)fflush(stdout);
}
vflag = DUP;
address += blocksize;
need = blocksize;