stdio and tty's require clearerr to insure EOF is reset
authorSam Leffler <sam@ucbvax.Berkeley.EDU>
Wed, 27 Jul 1983 08:55:41 +0000 (00:55 -0800)
committerSam Leffler <sam@ucbvax.Berkeley.EDU>
Wed, 27 Jul 1983 08:55:41 +0000 (00:55 -0800)
SCCS-vsn: usr.bin/mail/tty.c 2.6

usr/src/usr.bin/mail/tty.c

index 6064e98..157b120 100644 (file)
@@ -8,7 +8,7 @@
 
 #include "rcv.h"
 
 
 #include "rcv.h"
 
-static char *SccsId = "@(#)tty.c       2.5 %G%";
+static char *SccsId = "@(#)tty.c       2.6 %G%";
 
 static int     c_erase;                /* Current erase char */
 static int     c_kill;                 /* Current kill char */
 
 static int     c_erase;                /* Current erase char */
 static int     c_kill;                 /* Current kill char */
@@ -154,6 +154,7 @@ readtty(pr, src)
 # ifdef VMUNIX
        sigset(SIGCONT, ttycont);
 # endif VMUNIX
 # ifdef VMUNIX
        sigset(SIGCONT, ttycont);
 # endif VMUNIX
+       clearerr(stdin);
        while (cp2 < canonb + BUFSIZ) {
                c = getc(stdin);
                if (c == EOF || c == '\n')
        while (cp2 < canonb + BUFSIZ) {
                c = getc(stdin);
                if (c == EOF || c == '\n')