From: Denys Vlasenko Date: Mon, 13 Dec 2010 13:28:38 +0000 (+0100) Subject: more: exit if write to stdout errors out X-Git-Tag: 1_19_0~460 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=0b90de15375b643d2b21695fae3e46908e1effa6;p=oweals%2Fbusybox.git more: exit if write to stdout errors out Signed-off-by: Denys Vlasenko --- diff --git a/util-linux/more.c b/util-linux/more.c index 788609a08..ecac92821 100644 --- a/util-linux/more.c +++ b/util-linux/more.c @@ -191,6 +191,9 @@ int more_main(int argc UNUSED_PARAM, char **argv) } /* My small mind cannot fathom backspaces and UTF-8 */ putchar(c); + + if (ferror(stdout)) /* if tty was destroyed (closed xterm, etc) */ + goto end; } fclose(file); fflush_all();