*/
#ifdef notdef
-static char sccsid[] = "@(#)lex.c 5.7 (Berkeley) %G%";
+static char sccsid[] = "@(#)lex.c 5.13 (Berkeley) %G%";
#endif /* notdef */
#include "rcv.h"
int i;
struct stat stb;
static int shudclob;
- static char efile[128];
extern char tempMesg[];
extern int errno;
}
shudclob = 1;
edit = isedit;
- strncpy(efile, name, 128);
- editfile = efile;
if (name != mailname)
strcpy(mailname, name);
mailsize = fsize(ibuf);
commands()
{
- int eofloop, shudprompt, stop();
+ int eofloop, stop();
register int n;
char linebuf[LINESIZE];
int hangup(), contin();
if (signal(SIGHUP, SIG_IGN) != SIG_IGN)
signal(SIGHUP, hangup);
}
- shudprompt = intty && !sourcing;
for (;;) {
setexit();
return;
eofloop = 0;
top:
- if (shudprompt) {
+ if (!sourcing && value("interactive") != NOSTR) {
setjmp(commjmp);
signal(SIGCONT, contin);
printf(prompt);
}
fflush(stdout);
- sreset();
+ if (!sourcing)
+ sreset();
/*
* Read a line of commands from the current input
unstack();
goto more;
}
- if (value("ignoreeof") != NOSTR && shudprompt) {
+ if (value("interactive") != NOSTR &&
+ value("ignoreeof") != NOSTR) {
if (++eofloop < 25) {
printf("Use \"quit\" to quit.\n");
goto top;
}
/*
- * Branch here on hangup signal and simulate quit.
+ * Branch here on hangup signal and simulate "exit".
*/
/*ARGSUSED*/
hangup(s)
{
- holdsigs();
- if (edit) {
- if (setexit())
- exit(0);
- edstop();
- }
- else
- quit();
+ /* nothing to do? */
exit(0);
}
* give the message count, and print a header listing.
*/
-char *greeting = "Mail version %s. Type ? for help.\n";
-
-announce(pr)
+announce()
{
int vec[2], mdot;
- extern char *version;
- if (pr && value("quiet") == NOSTR)
- printf(greeting, version);
mdot = newfileinfo();
vec[0] = mdot;
vec[1] = 0;
dot = &message[mdot - 1];
- if (msgCount > 0 && !noheader) {
+ if (msgCount > 0 && value("noheader") == NOSTR) {
inithdr++;
headers(vec);
inithdr = 0;