projects
/
oweals
/
busybox.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1f3709e
)
more: exit if write to stdout errors out
author
Denys Vlasenko
<dvlasenk@redhat.com>
Mon, 13 Dec 2010 13:28:38 +0000
(14:28 +0100)
committer
Denys Vlasenko
<dvlasenk@redhat.com>
Mon, 13 Dec 2010 13:28:38 +0000
(14:28 +0100)
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
util-linux/more.c
patch
|
blob
|
history
diff --git
a/util-linux/more.c
b/util-linux/more.c
index 788609a081c455a85a04d9a8ac27d8ea8ff3121c..ecac928215a0157c58c844bfa628e51b0d7853d6 100644
(file)
--- 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();