more: exit if write to stdout errors out
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
This commit is contained in:
parent
1f3709ec74
commit
0b90de1537
@ -191,6 +191,9 @@ int more_main(int argc UNUSED_PARAM, char **argv)
|
|||||||
}
|
}
|
||||||
/* My small mind cannot fathom backspaces and UTF-8 */
|
/* My small mind cannot fathom backspaces and UTF-8 */
|
||||||
putchar(c);
|
putchar(c);
|
||||||
|
|
||||||
|
if (ferror(stdout)) /* if tty was destroyed (closed xterm, etc) */
|
||||||
|
goto end;
|
||||||
}
|
}
|
||||||
fclose(file);
|
fclose(file);
|
||||||
fflush_all();
|
fflush_all();
|
||||||
|
Loading…
Reference in New Issue
Block a user