summaryrefslogtreecommitdiffstats
path: root/usr.bin/dc
diff options
context:
space:
mode:
authorotto <otto@openbsd.org>2008-11-24 08:48:48 +0000
committerotto <otto@openbsd.org>2008-11-24 08:48:48 +0000
commit8ed24c87d77cbea7858c64ee66fa6d278f25933f (patch)
treef14a98db466985ff45180eb39d84ee03013a6ce1 /usr.bin/dc
parentdon't free extent on lastclose, it's static data now. (diff)
downloadwireguard-openbsd-8ed24c87d77cbea7858c64ee66fa6d278f25933f.tar.xz
wireguard-openbsd-8ed24c87d77cbea7858c64ee66fa6d278f25933f.zip
although there's no EOF condition defined for the handling of '?',
but anyway reset the eof condition on stdin, so you don't get an infinite loop in the typical program after a ^D. reported by Tamas TEVESZ.
Diffstat (limited to 'usr.bin/dc')
-rw-r--r--usr.bin/dc/bcode.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.bin/dc/bcode.c b/usr.bin/dc/bcode.c
index 37e5159d898..1ab0d747bba 100644
--- a/usr.bin/dc/bcode.c
+++ b/usr.bin/dc/bcode.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bcode.c,v 1.37 2008/04/28 06:35:09 otto Exp $ */
+/* $OpenBSD: bcode.c,v 1.38 2008/11/24 08:48:48 otto Exp $ */
/*
* Copyright (c) 2003, Otto Moerbeek <otto@drijf.net>
@@ -17,7 +17,7 @@
*/
#ifndef lint
-static const char rcsid[] = "$OpenBSD: bcode.c,v 1.37 2008/04/28 06:35:09 otto Exp $";
+static const char rcsid[] = "$OpenBSD: bcode.c,v 1.38 2008/11/24 08:48:48 otto Exp $";
#endif /* not lint */
#include <ssl/ssl.h>
@@ -1689,6 +1689,7 @@ eval_line(void)
struct source in;
char *p;
+ clearerr(stdin);
src_setstream(&in, stdin);
p = (*in.vtable->readline)(&in);
eval_string(p);