summaryrefslogtreecommitdiff
path: root/usr.bin/less/main.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2015-11-13 16:48:49 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2015-11-13 16:48:49 +0000
commit721331485113010a50f394bb958daaea53fc65a9 (patch)
tree4769c5859ad1d17a6fa74cbe0d39073984ea3b04 /usr.bin/less/main.c
parent1302fca7067bc48a64297069a4d2885ede31d707 (diff)
Add a flag argument to flush() to stop it calling quit() on error, then
use this from quit() to stop less blowing up the stack looping through quit()/flush() if stderr is closed (for example "less /missing 2</dev/null"). ok millert
Diffstat (limited to 'usr.bin/less/main.c')
-rw-r--r--usr.bin/less/main.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/usr.bin/less/main.c b/usr.bin/less/main.c
index ff26accda7d..abea6389442 100644
--- a/usr.bin/less/main.c
+++ b/usr.bin/less/main.c
@@ -388,7 +388,7 @@ quit(int status)
if (any_display && is_tty)
clear_bot();
deinit();
- flush();
+ flush(1);
raw_mode(0);
exit(status);
}