SCCS-vsn: usr.bin/mail/lex.c 5.13
SCCS-vsn: usr.bin/mail/quit.c 5.8
SCCS-vsn: usr.bin/mail/cmd3.c 5.9
SCCS-vsn: usr.bin/mail/main.c 5.13
SCCS-vsn: usr.bin/mail/fio.c 5.8
SCCS-vsn: usr.bin/mail/cmd1.c 5.9
SCCS-vsn: usr.bin/mail/def.h 5.10
-static char sccsid[] = "@(#)cmd1.c 5.8 (Berkeley) %G%";
+static char sccsid[] = "@(#)cmd1.c 5.9 (Berkeley) %G%";
#endif /* notdef */
#include "rcv.h"
#endif /* notdef */
#include "rcv.h"
mp = &message[mesg-1];
dot = mp;
if (value("quiet") == NOSTR)
mp = &message[mesg-1];
dot = mp;
if (value("quiet") == NOSTR)
- printf("Message %2d:\n", mesg);
+ printf("Message %d:\n", mesg);
ibuf = setinput(mp);
c = mp->m_lines;
if (!lineb)
ibuf = setinput(mp);
c = mp->m_lines;
if (!lineb)
-static char sccsid[] = "@(#)cmd3.c 5.8 (Berkeley) %G%";
+static char sccsid[] = "@(#)cmd3.c 5.9 (Berkeley) %G%";
#endif /* notdef */
#include "rcv.h"
#endif /* notdef */
#include "rcv.h"
* software without specific prior written permission. This software
* is provided ``as is'' without express or implied warranty.
*
* software without specific prior written permission. This software
* is provided ``as is'' without express or implied warranty.
*
- * @(#)def.h 5.9 (Berkeley) %G%
+ * @(#)def.h 5.10 (Berkeley) %G%
*/
#include <sys/param.h> /* includes <sys/types.h> */
*/
#include <sys/param.h> /* includes <sys/types.h> */
char *nameof();
char *nextword();
char *getenv();
char *nameof();
char *nextword();
char *getenv();
char *findmail();
char *ishfield();
char *malloc();
char *findmail();
char *ishfield();
char *malloc();
-static char sccsid[] = "@(#)fio.c 5.7 (Berkeley) %G%";
+static char sccsid[] = "@(#)fio.c 5.8 (Berkeley) %G%";
#endif /* notdef */
#include "rcv.h"
#endif /* notdef */
#include "rcv.h"
register struct message *mp;
FILE *obuf, *ibuf, *readstat;
struct stat statb;
register struct message *mp;
FILE *obuf, *ibuf, *readstat;
struct stat statb;
- char tempname[30], *id;
char *mktemp();
if (readonly)
char *mktemp();
if (readonly)
if (mp->m_flag & (MODIFY|MDELETED|MSTATUS))
gotcha++;
if (Tflag != NOSTR && (mp->m_flag & (MREAD|MDELETED)) != 0) {
if (mp->m_flag & (MODIFY|MDELETED|MSTATUS))
gotcha++;
if (Tflag != NOSTR && (mp->m_flag & (MREAD|MDELETED)) != 0) {
if ((id = hfield("article-id", mp)) != NOSTR)
fprintf(readstat, "%s\n", id);
}
if ((id = hfield("article-id", mp)) != NOSTR)
fprintf(readstat, "%s\n", id);
}
{
char xname[BUFSIZ];
char cmdbuf[BUFSIZ];
{
char xname[BUFSIZ];
char cmdbuf[BUFSIZ];
switch (*name) {
case '%':
switch (*name) {
case '%':
- return cp = savestr(findmail(name[1] ? name + 1 : myname));
+ return savestr(findmail(name[1] ? name + 1 : myname));
case '#':
if (name[1] != 0)
break;
case '#':
if (name[1] != 0)
break;
printf("No previous file\n");
return NOSTR;
}
printf("No previous file\n");
return NOSTR;
}
- cp = savestr(prevfile);
- return cp;
+ return savestr(prevfile);
case '&':
if (name[1] == 0 && (name = value("mbox")) == NOSTR) {
sprintf(xname, "%s/mbox", homedir);
case '&':
if (name[1] == 0 && (name = value("mbox")) == NOSTR) {
sprintf(xname, "%s/mbox", homedir);
name = savestr(xname);
}
if (!anyof(name, "~{[*?$`'\"\\"))
name = savestr(xname);
}
if (!anyof(name, "~{[*?$`'\"\\"))
if (pipe(pivec) < 0) {
perror("pipe");
if (pipe(pivec) < 0) {
perror("pipe");
}
sprintf(cmdbuf, "echo %s", name);
if ((pid = vfork()) == 0) {
}
sprintf(cmdbuf, "echo %s", name);
if ((pid = vfork()) == 0) {
perror("fork");
close(pivec[0]);
close(pivec[1]);
perror("fork");
close(pivec[0]);
close(pivec[1]);
}
close(pivec[1]);
l = read(pivec[0], xname, BUFSIZ);
}
close(pivec[1]);
l = read(pivec[0], xname, BUFSIZ);
;
if (s.w_status != 0 && s.w_termsig != SIGPIPE) {
fprintf(stderr, "\"Echo\" failed\n");
;
if (s.w_status != 0 && s.w_termsig != SIGPIPE) {
fprintf(stderr, "\"Echo\" failed\n");
}
if (l < 0) {
perror("read");
}
if (l < 0) {
perror("read");
}
if (l == 0) {
fprintf(stderr, "\"%s\": No match\n", name);
}
if (l == 0) {
fprintf(stderr, "\"%s\": No match\n", name);
}
if (l == BUFSIZ) {
fprintf(stderr, "Buffer overflow expanding \"%s\"\n", name);
}
if (l == BUFSIZ) {
fprintf(stderr, "Buffer overflow expanding \"%s\"\n", name);
}
xname[l] = 0;
for (cp = &xname[l-1]; *cp == '\n' && cp > xname; cp--)
;
}
xname[l] = 0;
for (cp = &xname[l-1]; *cp == '\n' && cp > xname; cp--)
;
if (any(' ', xname) && stat(xname, &sbuf) < 0) {
fprintf(stderr, "\"%s\": Ambiguous\n", name);
if (any(' ', xname) && stat(xname, &sbuf) < 0) {
fprintf(stderr, "\"%s\": Ambiguous\n", name);
- return(savestr(xname));
-
-err:
- return(NOSTR);
-static char sccsid[] = "@(#)lex.c 5.12 (Berkeley) %G%";
+static char sccsid[] = "@(#)lex.c 5.13 (Berkeley) %G%";
#endif /* notdef */
#include "rcv.h"
#endif /* notdef */
#include "rcv.h"
* give the message count, and print a header listing.
*/
* give the message count, and print a header listing.
*/
- if (pr && value("quiet") == NOSTR)
- printf( "Mail version %s. Type ? for help.\n", version);
mdot = newfileinfo();
vec[0] = mdot;
vec[1] = 0;
mdot = newfileinfo();
vec[0] = mdot;
vec[1] = 0;
#endif /* notdef */
#ifdef notdef
#endif /* notdef */
#ifdef notdef
-static char sccsid[] = "@(#)main.c 5.12 (Berkeley) %G%";
+static char sccsid[] = "@(#)main.c 5.13 (Berkeley) %G%";
#endif /* notdef */
#include "rcv.h"
#endif /* notdef */
#include "rcv.h"
* Figure out whether we are being run interactively, set up
* all the temporary files, buffer standard output, and so forth.
*/
* Figure out whether we are being run interactively, set up
* all the temporary files, buffer standard output, and so forth.
*/
mypid = getpid();
if (isatty(0))
assign("interactive", "");
image = -1;
mypid = getpid();
if (isatty(0))
assign("interactive", "");
image = -1;
/*
* Now, determine how we are being used.
* We successively pick off instances of -r, -h, -f, and -i.
/*
* Now, determine how we are being used.
* We successively pick off instances of -r, -h, -f, and -i.
* of users to mail to. Argp will be set to point to the
* first of these users.
*/
* of users to mail to. Argp will be set to point to the
* first of these users.
*/
ef = NOSTR;
to = NULL;
cc = NULL;
ef = NOSTR;
to = NULL;
cc = NULL;
exit(1);
}
if (setjmp(hdrjmp) == 0) {
exit(1);
}
if (setjmp(hdrjmp) == 0) {
+ extern char *version;
+
if ((prevint = signal(SIGINT, SIG_IGN)) != SIG_IGN)
signal(SIGINT, hdrstop);
if ((prevint = signal(SIGINT, SIG_IGN)) != SIG_IGN)
signal(SIGINT, hdrstop);
+ if (value("quiet") == NOSTR)
+ printf("Mail version %s. Type ? for help.\n",
+ version);
+ announce();
fflush(stdout);
signal(SIGINT, prevint);
}
fflush(stdout);
signal(SIGINT, prevint);
}
-static char sccsid[] = "@(#)quit.c 5.7 (Berkeley) %G%";
+static char sccsid[] = "@(#)quit.c 5.8 (Berkeley) %G%";
#endif /* notdef */
#include "rcv.h"
#endif /* notdef */
#include "rcv.h"
register int c;
extern char tempQuit[], tempResid[];
struct stat minfo;
register int c;
extern char tempQuit[], tempResid[];
struct stat minfo;
if (mp->m_flag & MODIFY)
modify++;
if (Tflag != NOSTR && (mp->m_flag & (MREAD|MDELETED)) != 0) {
if (mp->m_flag & MODIFY)
modify++;
if (Tflag != NOSTR && (mp->m_flag & (MREAD|MDELETED)) != 0) {
- id = hfield("article-id", mp);
- if (id != NOSTR)
+ char *id;
+
+ if ((id = hfield("article-id", mp)) != NOSTR)
fprintf(readstat, "%s\n", id);
}
}
if (Tflag != NOSTR)
fclose(readstat);
if (p == msgCount && !modify && !anystat) {
fprintf(readstat, "%s\n", id);
}
}
if (Tflag != NOSTR)
fclose(readstat);
if (p == msgCount && !modify && !anystat) {
- if (p == 1)
- printf("Held 1 message in %s\n", mailname);
- else
- printf("Held %2d messages in %s\n", p, mailname);
+ printf("Held %d message%s in %s\n",
+ p, p == 1 ? "" : "s", mailname);