more: exit if write to stdout errors out
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
This commit is contained in:
@ -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();
|
||||
|
Reference in New Issue
Block a user