Date: Thu, 29 Jul 2021 06:41:27 GMT From: Poul-Henning Kamp <phk@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: git: 272144ab4109 - main - hexdump: Flush stdout after '*' (repeat) lines. Message-ID: <202107290641.16T6fRuN013748@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch main has been updated by phk: URL: https://cgit.FreeBSD.org/src/commit/?id=272144ab410901f8b74db2ec97e09d64983d4b31 commit 272144ab410901f8b74db2ec97e09d64983d4b31 Author: Poul-Henning Kamp <phk@FreeBSD.org> AuthorDate: 2021-07-29 06:37:39 +0000 Commit: Poul-Henning Kamp <phk@FreeBSD.org> CommitDate: 2021-07-29 06:40:57 +0000 hexdump: Flush stdout after '*' (repeat) lines. The canonical annoying example being: hexdump < /dev/zero | less --- usr.bin/hexdump/display.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/usr.bin/hexdump/display.c b/usr.bin/hexdump/display.c index 697443693d8e..5e5b30b73fd0 100644 --- a/usr.bin/hexdump/display.c +++ b/usr.bin/hexdump/display.c @@ -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;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202107290641.16T6fRuN013748>