diff options
author | Denys Vlasenko <dvlasenk@redhat.com> | 2010-12-13 14:28:38 +0100 |
---|---|---|
committer | Denys Vlasenko <dvlasenk@redhat.com> | 2010-12-13 14:28:38 +0100 |
commit | 0b90de15375b643d2b21695fae3e46908e1effa6 (patch) | |
tree | 26d803c4fe387ad3fd2022d020fd5a5023e0d2e8 /util-linux/more.c | |
parent | 1f3709ec741cab0ef635059b225fed02b18ca664 (diff) | |
download | busybox-w32-0b90de15375b643d2b21695fae3e46908e1effa6.tar.gz busybox-w32-0b90de15375b643d2b21695fae3e46908e1effa6.tar.bz2 busybox-w32-0b90de15375b643d2b21695fae3e46908e1effa6.zip |
more: exit if write to stdout errors out
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
Diffstat (limited to '')
-rw-r--r-- | util-linux/more.c | 3 |
1 files changed, 3 insertions, 0 deletions
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) | |||
191 | } | 191 | } |
192 | /* My small mind cannot fathom backspaces and UTF-8 */ | 192 | /* My small mind cannot fathom backspaces and UTF-8 */ |
193 | putchar(c); | 193 | putchar(c); |
194 | |||
195 | if (ferror(stdout)) /* if tty was destroyed (closed xterm, etc) */ | ||
196 | goto end; | ||
194 | } | 197 | } |
195 | fclose(file); | 198 | fclose(file); |
196 | fflush_all(); | 199 | fflush_all(); |