diff options
author | Otto Moerbeek <otto@cvs.openbsd.org> | 2008-11-24 08:48:49 +0000 |
---|---|---|
committer | Otto Moerbeek <otto@cvs.openbsd.org> | 2008-11-24 08:48:49 +0000 |
commit | d31aedf981e3d044892b77eabbb97270edef8cdf (patch) | |
tree | 1e0665f7a56991552c651ad7b59234987784c93e | |
parent | 224ede3590f5f9d2b688e8d46059b8e722353499 (diff) |
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.
-rw-r--r-- | usr.bin/dc/bcode.c | 5 |
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); |