mean it. this is to combat a strange dialup problem that makes your
program read eofs forever.
SCCS-vsn: usr.bin/mail/lex.c 2.3
* Lexical processing of commands.
*/
* Lexical processing of commands.
*/
-static char *SccsId = "@(#)lex.c 2.2 %G%";
+static char *SccsId = "@(#)lex.c 2.3 %G%";
/*
* Set up editing on the given file name.
/*
* Set up editing on the given file name.
- int prompt, firstsw, stop();
+ int eofloop, prompt, firstsw, stop();
register int n;
char linebuf[LINESIZE];
int hangup(), contin();
register int n;
char linebuf[LINESIZE];
int hangup(), contin();
if (!rcvmode && !sourcing)
return;
if (!rcvmode && !sourcing)
return;
top:
if (prompt && !sourcing) {
sigrelse(SIGCONT);
top:
if (prompt && !sourcing) {
sigrelse(SIGCONT);
goto more;
}
if (value("ignoreeof") != NOSTR && prompt) {
goto more;
}
if (value("ignoreeof") != NOSTR && prompt) {
- printf("Use \"quit\" to quit.\n");
- goto top;
+ if (++eofloop < 25) {
+ printf("Use \"quit\" to quit.\n");
+ goto top;
+ }