mirror of
https://github.com/openbsd/src.git
synced 2024-12-22 16:42:56 -08:00
NOSTR -> NULL
Use sigsetjmp/siglongjmp instead of sigjmp/longjmp for portability.
This commit is contained in:
parent
f0e43013ae
commit
c318c72bec
@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: aux.c,v 1.6 1997/07/13 23:53:56 millert Exp $ */
|
||||
/* $OpenBSD: aux.c,v 1.7 1997/07/14 00:24:24 millert Exp $ */
|
||||
/* $NetBSD: aux.c,v 1.5 1997/05/13 06:15:52 mikel Exp $ */
|
||||
|
||||
/*
|
||||
@ -38,7 +38,7 @@
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)aux.c 8.1 (Berkeley) 6/6/93";
|
||||
#else
|
||||
static char rcsid[] = "$OpenBSD: aux.c,v 1.6 1997/07/13 23:53:56 millert Exp $";
|
||||
static char rcsid[] = "$OpenBSD: aux.c,v 1.7 1997/07/14 00:24:24 millert Exp $";
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
@ -62,7 +62,7 @@ savestr(str)
|
||||
char *new;
|
||||
int size = strlen(str) + 1;
|
||||
|
||||
if ((new = salloc(size)) != NOSTR)
|
||||
if ((new = salloc(size)) != NULL)
|
||||
(void)memcpy(new, str, size);
|
||||
return(new);
|
||||
}
|
||||
@ -78,7 +78,7 @@ save2str(str, old)
|
||||
int newsize = strlen(str) + 1;
|
||||
int oldsize = old ? strlen(old) + 1 : 0;
|
||||
|
||||
if ((new = salloc(newsize + oldsize)) != NOSTR) {
|
||||
if ((new = salloc(newsize + oldsize)) != NULL) {
|
||||
if (oldsize) {
|
||||
(void)memcpy(new, old, oldsize);
|
||||
new[oldsize - 1] = ' ';
|
||||
@ -159,14 +159,14 @@ argcount(argv)
|
||||
{
|
||||
register char **ap;
|
||||
|
||||
for (ap = argv; *ap++ != NOSTR;)
|
||||
for (ap = argv; *ap++ != NULL;)
|
||||
;
|
||||
return(ap - argv - 1);
|
||||
}
|
||||
|
||||
/*
|
||||
* Return the desired header line from the passed message
|
||||
* pointer (or NOSTR if the desired header field is not available).
|
||||
* pointer (or NULL if the desired header field is not available).
|
||||
*/
|
||||
char *
|
||||
hfield(field, mp)
|
||||
@ -177,13 +177,13 @@ hfield(field, mp)
|
||||
char linebuf[LINESIZE];
|
||||
register int lc;
|
||||
register char *hfield;
|
||||
char *colon, *oldhfield = NOSTR;
|
||||
char *colon, *oldhfield = NULL;
|
||||
|
||||
ibuf = setinput(mp);
|
||||
if ((lc = mp->m_lines - 1) < 0)
|
||||
return(NOSTR);
|
||||
return(NULL);
|
||||
if (readline(ibuf, linebuf, LINESIZE) < 0)
|
||||
return(NOSTR);
|
||||
return(NULL);
|
||||
while (lc > 0) {
|
||||
if ((lc = gethfield(ibuf, linebuf, lc, &colon)) < 0)
|
||||
return(oldhfield);
|
||||
@ -318,7 +318,7 @@ source(v)
|
||||
FILE *fi;
|
||||
char *cp;
|
||||
|
||||
if ((cp = expand(*arglist)) == NOSTR)
|
||||
if ((cp = expand(*arglist)) == NULL)
|
||||
return(1);
|
||||
if ((fi = Fopen(cp, "r")) == NULL) {
|
||||
warn(cp);
|
||||
@ -464,10 +464,10 @@ skin(name)
|
||||
int gotlt, lastsp;
|
||||
char nbuf[BUFSIZ];
|
||||
|
||||
if (name == NOSTR)
|
||||
return(NOSTR);
|
||||
if (strchr(name, '(') == NOSTR && strchr(name, '<') == NOSTR
|
||||
&& strchr(name, ' ') == NOSTR)
|
||||
if (name == NULL)
|
||||
return(NULL);
|
||||
if (strchr(name, '(') == NULL && strchr(name, '<') == NULL
|
||||
&& strchr(name, ' ') == NULL)
|
||||
return(name);
|
||||
gotlt = 0;
|
||||
lastsp = 0;
|
||||
@ -573,9 +573,9 @@ name1(mp, reptype)
|
||||
register FILE *ibuf;
|
||||
int first = 1;
|
||||
|
||||
if ((cp = hfield("from", mp)) != NOSTR)
|
||||
if ((cp = hfield("from", mp)) != NULL)
|
||||
return(cp);
|
||||
if (reptype == 0 && (cp = hfield("sender", mp)) != NOSTR)
|
||||
if (reptype == 0 && (cp = hfield("sender", mp)) != NULL)
|
||||
return(cp);
|
||||
ibuf = setinput(mp);
|
||||
namebuf[0] = '\0';
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: cmd1.c,v 1.7 1997/07/13 23:53:57 millert Exp $ */
|
||||
/* $OpenBSD: cmd1.c,v 1.8 1997/07/14 00:24:24 millert Exp $ */
|
||||
/* $NetBSD: cmd1.c,v 1.9 1997/07/09 05:29:48 mikel Exp $ */
|
||||
|
||||
/*-
|
||||
@ -38,7 +38,7 @@
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)cmd1.c 8.2 (Berkeley) 4/20/95";
|
||||
#else
|
||||
static char rcsid[] = "$OpenBSD: cmd1.c,v 1.7 1997/07/13 23:53:57 millert Exp $";
|
||||
static char rcsid[] = "$OpenBSD: cmd1.c,v 1.8 1997/07/14 00:24:24 millert Exp $";
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
@ -146,7 +146,7 @@ screensize()
|
||||
int s;
|
||||
char *cp;
|
||||
|
||||
if ((cp = value("screen")) != NOSTR && (s = atoi(cp)) > 0)
|
||||
if ((cp = value("screen")) != NULL && (s = atoi(cp)) > 0)
|
||||
return(s);
|
||||
return(screenheight - 4);
|
||||
}
|
||||
@ -186,7 +186,7 @@ printhead(mesg)
|
||||
|
||||
mp = &message[mesg-1];
|
||||
(void)readline(setinput(mp), headline, LINESIZE);
|
||||
if ((subjline = hfield("subject", mp)) == NOSTR)
|
||||
if ((subjline = hfield("subject", mp)) == NULL)
|
||||
subjline = hfield("subj", mp);
|
||||
/*
|
||||
* Bletch!
|
||||
@ -206,9 +206,9 @@ printhead(mesg)
|
||||
parse(headline, &hl, pbuf);
|
||||
snprintf(wcount, sizeof(wcount), "%3d/%-5d", mp->m_lines, mp->m_size);
|
||||
subjlen = screenwidth - 50 - strlen(wcount);
|
||||
name = value("show-rcpt") != NOSTR ?
|
||||
name = value("show-rcpt") != NULL ?
|
||||
skin(hfield("to", mp)) : nameof(mp, 0);
|
||||
if (subjline == NOSTR || subjlen < 0) /* pretty pathetic */
|
||||
if (subjline == NULL || subjlen < 0) /* pretty pathetic */
|
||||
printf("%c%c%3d %-20.20s %16.16s %s\n",
|
||||
curind, dispc, mesg, name, hl.l_date, wcount);
|
||||
else
|
||||
@ -246,7 +246,7 @@ pcmdlist(v)
|
||||
putchar('\n');
|
||||
cc = strlen(cp->c_name) + 2;
|
||||
}
|
||||
if ((cp+1)->c_name != NOSTR)
|
||||
if ((cp+1)->c_name != NULL)
|
||||
printf("%s, ", cp->c_name);
|
||||
else
|
||||
puts(cp->c_name);
|
||||
@ -304,7 +304,7 @@ Type(v)
|
||||
/*
|
||||
* Type out the messages requested.
|
||||
*/
|
||||
jmp_buf pipestop;
|
||||
sigjmp_buf pipestop;
|
||||
int
|
||||
type1(msgvec, doign, page)
|
||||
int *msgvec;
|
||||
@ -316,16 +316,16 @@ type1(msgvec, doign, page)
|
||||
int nlines;
|
||||
FILE *obuf;
|
||||
#if __GNUC__
|
||||
/* Avoid longjmp clobbering */
|
||||
/* Avoid siglongjmp clobbering */
|
||||
(void)&cp;
|
||||
(void)&obuf;
|
||||
#endif
|
||||
|
||||
obuf = stdout;
|
||||
if (setjmp(pipestop))
|
||||
if (sigsetjmp(pipestop, 1))
|
||||
goto close_pipe;
|
||||
if (value("interactive") != NOSTR &&
|
||||
(page || (cp = value("crt")) != NOSTR)) {
|
||||
if (value("interactive") != NULL &&
|
||||
(page || (cp = value("crt")) != NULL)) {
|
||||
nlines = 0;
|
||||
if (!page) {
|
||||
for (ip = msgvec; *ip && ip-msgvec < msgCount; ip++)
|
||||
@ -347,9 +347,9 @@ type1(msgvec, doign, page)
|
||||
mp = &message[*ip - 1];
|
||||
touch(mp);
|
||||
dot = mp;
|
||||
if (value("quiet") == NOSTR)
|
||||
if (value("quiet") == NULL)
|
||||
fprintf(obuf, "Message %d:\n", *ip);
|
||||
(void)send(mp, obuf, doign ? ignore : 0, NOSTR);
|
||||
(void)send(mp, obuf, doign ? ignore : 0, NULL);
|
||||
}
|
||||
close_pipe:
|
||||
if (obuf != stdout) {
|
||||
@ -371,7 +371,7 @@ void
|
||||
brokpipe(signo)
|
||||
int signo;
|
||||
{
|
||||
longjmp(pipestop, 1);
|
||||
siglongjmp(pipestop, 1);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -392,7 +392,7 @@ top(v)
|
||||
|
||||
topl = 5;
|
||||
valtop = value("toplines");
|
||||
if (valtop != NOSTR) {
|
||||
if (valtop != NULL) {
|
||||
topl = atoi(valtop);
|
||||
if (topl < 0 || topl > 10000)
|
||||
topl = 5;
|
||||
@ -402,7 +402,7 @@ top(v)
|
||||
mp = &message[*ip - 1];
|
||||
touch(mp);
|
||||
dot = mp;
|
||||
if (value("quiet") == NOSTR)
|
||||
if (value("quiet") == NULL)
|
||||
printf("Message %d:\n", *ip);
|
||||
ibuf = setinput(mp);
|
||||
c = mp->m_lines;
|
||||
@ -469,9 +469,9 @@ folders(v)
|
||||
puts("No value set for \"folder\"");
|
||||
return(1);
|
||||
}
|
||||
if ((cmd = value("LISTER")) == NOSTR)
|
||||
if ((cmd = value("LISTER")) == NULL)
|
||||
cmd = "ls";
|
||||
(void)run_command(cmd, 0, -1, -1, dirname, NOSTR, NOSTR);
|
||||
(void)run_command(cmd, 0, -1, -1, dirname, NULL, NULL);
|
||||
return(0);
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: cmd2.c,v 1.4 1997/07/13 23:53:57 millert Exp $ */
|
||||
/* $OpenBSD: cmd2.c,v 1.5 1997/07/14 00:24:24 millert Exp $ */
|
||||
/* $NetBSD: cmd2.c,v 1.7 1997/05/17 19:55:10 pk Exp $ */
|
||||
|
||||
/*
|
||||
@ -38,7 +38,7 @@
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)cmd2.c 8.1 (Berkeley) 6/6/93";
|
||||
#else
|
||||
static char rcsid[] = "$OpenBSD: cmd2.c,v 1.4 1997/07/13 23:53:57 millert Exp $";
|
||||
static char rcsid[] = "$OpenBSD: cmd2.c,v 1.5 1997/07/14 00:24:24 millert Exp $";
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
@ -177,7 +177,7 @@ save1(str, mark, cmd, ignore)
|
||||
FILE *obuf;
|
||||
|
||||
msgvec = (int *)salloc((msgCount + 2) * sizeof(*msgvec));
|
||||
if ((file = snarf(str, &f)) == NOSTR)
|
||||
if ((file = snarf(str, &f)) == NULL)
|
||||
return(1);
|
||||
if (!f) {
|
||||
*msgvec = first(0, MMNORM);
|
||||
@ -189,7 +189,7 @@ save1(str, mark, cmd, ignore)
|
||||
}
|
||||
if (f && getmsglist(str, msgvec, 0) < 0)
|
||||
return(1);
|
||||
if ((file = expand(file)) == NOSTR)
|
||||
if ((file = expand(file)) == NULL)
|
||||
return(1);
|
||||
printf("\"%s\" ", file);
|
||||
fflush(stdout);
|
||||
@ -198,13 +198,13 @@ save1(str, mark, cmd, ignore)
|
||||
else
|
||||
disp = "[New file]";
|
||||
if ((obuf = Fopen(file, "a")) == NULL) {
|
||||
warn(NOSTR);
|
||||
warn(NULL);
|
||||
return(1);
|
||||
}
|
||||
for (ip = msgvec; *ip && ip-msgvec < msgCount; ip++) {
|
||||
mp = &message[*ip - 1];
|
||||
touch(mp);
|
||||
if (send(mp, obuf, ignore, NOSTR) < 0) {
|
||||
if (send(mp, obuf, ignore, NULL) < 0) {
|
||||
perror(file);
|
||||
(void)Fclose(obuf);
|
||||
return(1);
|
||||
@ -236,7 +236,7 @@ swrite(v)
|
||||
/*
|
||||
* Snarf the file from the end of the command line and
|
||||
* return a pointer to it. If there is no file attached,
|
||||
* just return NOSTR. Put a null in front of the file
|
||||
* just return NULL. Put a null in front of the file
|
||||
* name so that the message list processing won't see it,
|
||||
* unless the file name is the only thing on the line, in
|
||||
* which case, return 0 in the reference flag variable.
|
||||
@ -268,7 +268,7 @@ snarf(linebuf, flag)
|
||||
cp--;
|
||||
if (*cp == '\0') {
|
||||
puts("No file specified.");
|
||||
return(NOSTR);
|
||||
return(NULL);
|
||||
}
|
||||
if (isspace(*cp))
|
||||
*cp++ = 0;
|
||||
@ -493,7 +493,7 @@ ignore1(list, tab, which)
|
||||
register struct ignore *igp;
|
||||
char **ap;
|
||||
|
||||
if (*list == NOSTR)
|
||||
if (*list == NULL)
|
||||
return(igshow(tab, which));
|
||||
for (ap = list; *ap != 0; ap++) {
|
||||
istrcpy(field, *ap);
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: cmd3.c,v 1.6 1997/07/13 23:53:58 millert Exp $ */
|
||||
/* $OpenBSD: cmd3.c,v 1.7 1997/07/14 00:24:25 millert Exp $ */
|
||||
/* $NetBSD: cmd3.c,v 1.8 1997/07/09 05:29:49 mikel Exp $ */
|
||||
|
||||
/*
|
||||
@ -38,7 +38,7 @@
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)cmd3.c 8.2 (Berkeley) 4/20/95";
|
||||
#else
|
||||
static char rcsid[] = "$OpenBSD: cmd3.c,v 1.6 1997/07/13 23:53:58 millert Exp $";
|
||||
static char rcsid[] = "$OpenBSD: cmd3.c,v 1.7 1997/07/14 00:24:25 millert Exp $";
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
@ -68,9 +68,9 @@ shell(v)
|
||||
(void)strcpy(cmd, str);
|
||||
if (bangexp(cmd) < 0)
|
||||
return(1);
|
||||
if ((shell = value("SHELL")) == NOSTR)
|
||||
if ((shell = value("SHELL")) == NULL)
|
||||
shell = _PATH_CSHELL;
|
||||
(void)run_command(shell, 0, -1, -1, "-c", cmd, NOSTR);
|
||||
(void)run_command(shell, 0, -1, -1, "-c", cmd, NULL);
|
||||
(void)signal(SIGINT, sigint);
|
||||
puts("!");
|
||||
return(0);
|
||||
@ -87,9 +87,9 @@ dosh(v)
|
||||
sig_t sigint = signal(SIGINT, SIG_IGN);
|
||||
char *shell;
|
||||
|
||||
if ((shell = value("SHELL")) == NOSTR)
|
||||
if ((shell = value("SHELL")) == NULL)
|
||||
shell = _PATH_CSHELL;
|
||||
(void)run_command(shell, 0, -1, -1, NOSTR, NOSTR, NOSTR);
|
||||
(void)run_command(shell, 0, -1, -1, NULL, NULL, NULL);
|
||||
(void)signal(SIGINT, sigint);
|
||||
putchar('\n');
|
||||
return(0);
|
||||
@ -181,10 +181,10 @@ schdir(v)
|
||||
char **arglist = v;
|
||||
char *cp;
|
||||
|
||||
if (*arglist == NOSTR)
|
||||
if (*arglist == NULL)
|
||||
cp = homedir;
|
||||
else
|
||||
if ((cp = expand(*arglist)) == NOSTR)
|
||||
if ((cp = expand(*arglist)) == NULL)
|
||||
return(1);
|
||||
if (chdir(cp) < 0) {
|
||||
warn(cp);
|
||||
@ -198,7 +198,7 @@ respond(v)
|
||||
void *v;
|
||||
{
|
||||
int *msgvec = v;
|
||||
if (value("Replyall") == NOSTR)
|
||||
if (value("Replyall") == NULL)
|
||||
return(_respond(msgvec));
|
||||
else
|
||||
return(_Respond(msgvec));
|
||||
@ -225,11 +225,11 @@ _respond(msgvec)
|
||||
mp = &message[msgvec[0] - 1];
|
||||
touch(mp);
|
||||
dot = mp;
|
||||
if ((rcv = skin(hfield("from", mp))) == NOSTR)
|
||||
if ((rcv = skin(hfield("from", mp))) == NULL)
|
||||
rcv = skin(nameof(mp, 1));
|
||||
if ((replyto = skin(hfield("reply-to", mp))) != NOSTR)
|
||||
if ((replyto = skin(hfield("reply-to", mp))) != NULL)
|
||||
np = extract(replyto, GTO);
|
||||
else if ((cp = skin(hfield("to", mp))) != NOSTR)
|
||||
else if ((cp = skin(hfield("to", mp))) != NULL)
|
||||
np = extract(cp, GTO);
|
||||
else
|
||||
np = NIL;
|
||||
@ -242,18 +242,18 @@ _respond(msgvec)
|
||||
if (altnames)
|
||||
for (ap = altnames; *ap; ap++)
|
||||
np = delname(np, *ap);
|
||||
if (np != NIL && replyto == NOSTR)
|
||||
if (np != NIL && replyto == NULL)
|
||||
np = cat(np, extract(rcv, GTO));
|
||||
else if (np == NIL) {
|
||||
if (replyto != NOSTR)
|
||||
if (replyto != NULL)
|
||||
puts("Empty reply-to field -- replying to author");
|
||||
np = extract(rcv, GTO);
|
||||
}
|
||||
head.h_to = np;
|
||||
if ((head.h_subject = hfield("subject", mp)) == NOSTR)
|
||||
if ((head.h_subject = hfield("subject", mp)) == NULL)
|
||||
head.h_subject = hfield("subj", mp);
|
||||
head.h_subject = reedit(head.h_subject);
|
||||
if (replyto == NOSTR && (cp = skin(hfield("cc", mp))) != NOSTR) {
|
||||
if (replyto == NULL && (cp = skin(hfield("cc", mp))) != NULL) {
|
||||
np = elide(extract(cp, GCC));
|
||||
np = delname(np, myname);
|
||||
if (altnames != 0)
|
||||
@ -278,8 +278,8 @@ reedit(subj)
|
||||
{
|
||||
char *newsubj;
|
||||
|
||||
if (subj == NOSTR)
|
||||
return(NOSTR);
|
||||
if (subj == NULL)
|
||||
return(NULL);
|
||||
if ((subj[0] == 'r' || subj[0] == 'R') &&
|
||||
(subj[1] == 'e' || subj[1] == 'E') &&
|
||||
subj[2] == ':')
|
||||
@ -381,7 +381,7 @@ set(v)
|
||||
char varbuf[BUFSIZ], **ap, **p;
|
||||
int errs, h, s;
|
||||
|
||||
if (*arglist == NOSTR) {
|
||||
if (*arglist == NULL) {
|
||||
for (h = 0, s = 1; h < HSHSIZE; h++)
|
||||
for (vp = variables[h]; vp != NOVAR; vp = vp->v_link)
|
||||
s++;
|
||||
@ -389,14 +389,14 @@ set(v)
|
||||
for (h = 0, p = ap; h < HSHSIZE; h++)
|
||||
for (vp = variables[h]; vp != NOVAR; vp = vp->v_link)
|
||||
*p++ = vp->v_name;
|
||||
*p = NOSTR;
|
||||
*p = NULL;
|
||||
sort(ap);
|
||||
for (p = ap; *p != NOSTR; p++)
|
||||
for (p = ap; *p != NULL; p++)
|
||||
printf("%s\t%s\n", *p, value(*p));
|
||||
return(0);
|
||||
}
|
||||
errs = 0;
|
||||
for (ap = arglist; *ap != NOSTR; ap++) {
|
||||
for (ap = arglist; *ap != NULL; ap++) {
|
||||
cp = *ap;
|
||||
cp2 = varbuf;
|
||||
while (*cp != '=' && *cp != '\0')
|
||||
@ -429,7 +429,7 @@ unset(v)
|
||||
char **ap;
|
||||
|
||||
errs = 0;
|
||||
for (ap = arglist; *ap != NOSTR; ap++) {
|
||||
for (ap = arglist; *ap != NULL; ap++) {
|
||||
if ((vp2 = lookup(*ap)) == NOVAR) {
|
||||
if (!sourcing) {
|
||||
printf("\"%s\": undefined variable\n", *ap);
|
||||
@ -469,7 +469,7 @@ group(v)
|
||||
int s;
|
||||
char **ap, *gname, **p;
|
||||
|
||||
if (*argv == NOSTR) {
|
||||
if (*argv == NULL) {
|
||||
for (h = 0, s = 1; h < HSHSIZE; h++)
|
||||
for (gh = groups[h]; gh != NOGRP; gh = gh->g_link)
|
||||
s++;
|
||||
@ -477,13 +477,13 @@ group(v)
|
||||
for (h = 0, p = ap; h < HSHSIZE; h++)
|
||||
for (gh = groups[h]; gh != NOGRP; gh = gh->g_link)
|
||||
*p++ = gh->g_name;
|
||||
*p = NOSTR;
|
||||
*p = NULL;
|
||||
sort(ap);
|
||||
for (p = ap; *p != NOSTR; p++)
|
||||
for (p = ap; *p != NULL; p++)
|
||||
printgroup(*p);
|
||||
return(0);
|
||||
}
|
||||
if (argv[1] == NOSTR) {
|
||||
if (argv[1] == NULL) {
|
||||
printgroup(*argv);
|
||||
return(0);
|
||||
}
|
||||
@ -503,7 +503,7 @@ group(v)
|
||||
* later anyway.
|
||||
*/
|
||||
|
||||
for (ap = argv+1; *ap != NOSTR; ap++) {
|
||||
for (ap = argv+1; *ap != NULL; ap++) {
|
||||
gp = (struct group *)calloc(sizeof(*gp), 1);
|
||||
gp->ge_name = vcopy(*ap);
|
||||
gp->ge_link = gh->g_list;
|
||||
@ -522,7 +522,7 @@ sort(list)
|
||||
{
|
||||
register char **ap;
|
||||
|
||||
for (ap = list; *ap != NOSTR; ap++)
|
||||
for (ap = list; *ap != NULL; ap++)
|
||||
;
|
||||
if (ap-list < 2)
|
||||
return;
|
||||
@ -562,7 +562,7 @@ file(v)
|
||||
{
|
||||
char **argv = v;
|
||||
|
||||
if (argv[0] == NOSTR) {
|
||||
if (argv[0] == NULL) {
|
||||
newfileinfo(0);
|
||||
return(0);
|
||||
}
|
||||
@ -583,9 +583,9 @@ echo(v)
|
||||
register char **ap;
|
||||
register char *cp;
|
||||
|
||||
for (ap = argv; *ap != NOSTR; ap++) {
|
||||
for (ap = argv; *ap != NULL; ap++) {
|
||||
cp = *ap;
|
||||
if ((cp = expand(cp)) != NOSTR) {
|
||||
if ((cp = expand(cp)) != NULL) {
|
||||
if (ap != argv)
|
||||
putchar(' ');
|
||||
fputs(cp, stdout);
|
||||
@ -600,7 +600,7 @@ Respond(v)
|
||||
void *v;
|
||||
{
|
||||
int *msgvec = v;
|
||||
if (value("Replyall") == NOSTR)
|
||||
if (value("Replyall") == NULL)
|
||||
return(_Respond(msgvec));
|
||||
else
|
||||
return(_respond(msgvec));
|
||||
@ -625,14 +625,14 @@ _Respond(msgvec)
|
||||
mp = &message[*ap - 1];
|
||||
touch(mp);
|
||||
dot = mp;
|
||||
if ((cp = skin(hfield("from", mp))) == NOSTR)
|
||||
if ((cp = skin(hfield("from", mp))) == NULL)
|
||||
cp = skin(nameof(mp, 2));
|
||||
head.h_to = cat(head.h_to, extract(cp, GTO));
|
||||
}
|
||||
if (head.h_to == NIL)
|
||||
return(0);
|
||||
mp = &message[msgvec[0] - 1];
|
||||
if ((head.h_subject = hfield("subject", mp)) == NOSTR)
|
||||
if ((head.h_subject = hfield("subject", mp)) == NULL)
|
||||
head.h_subject = hfield("subj", mp);
|
||||
head.h_subject = reedit(head.h_subject);
|
||||
head.h_cc = NIL;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: collect.c,v 1.7 1997/07/13 23:53:58 millert Exp $ */
|
||||
/* $OpenBSD: collect.c,v 1.8 1997/07/14 00:24:25 millert Exp $ */
|
||||
/* $NetBSD: collect.c,v 1.9 1997/07/09 05:25:45 mikel Exp $ */
|
||||
|
||||
/*
|
||||
@ -38,7 +38,7 @@
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)collect.c 8.2 (Berkeley) 4/19/94";
|
||||
#else
|
||||
static char rcsid[] = "$OpenBSD: collect.c,v 1.7 1997/07/13 23:53:58 millert Exp $";
|
||||
static char rcsid[] = "$OpenBSD: collect.c,v 1.8 1997/07/14 00:24:25 millert Exp $";
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
@ -71,9 +71,9 @@ static sig_t savettin; /* Previous SIGTTIN value */
|
||||
static FILE *collf; /* File for saving away */
|
||||
static int hadintr; /* Have seen one SIGINT so far */
|
||||
|
||||
static jmp_buf colljmp; /* To get back to work */
|
||||
static int colljmp_p; /* whether to long jump */
|
||||
static jmp_buf collabort; /* To end collection with error */
|
||||
static sigjmp_buf colljmp; /* To get back to work */
|
||||
static int colljmp_p; /* whether to long jump */
|
||||
static sigjmp_buf collabort; /* To end collection with error */
|
||||
|
||||
FILE *
|
||||
collect(hp, printheaders)
|
||||
@ -90,7 +90,7 @@ collect(hp, printheaders)
|
||||
int longline, lastlong, rc; /* Can deal with lines > LINESIZE */
|
||||
|
||||
#if __GNUC__
|
||||
/* Avoid longjmp clobbering */
|
||||
/* Avoid siglongjmp clobbering */
|
||||
(void)&escape;
|
||||
(void)&eofcount;
|
||||
(void)&getsub;
|
||||
@ -110,7 +110,7 @@ collect(hp, printheaders)
|
||||
savetstp = signal(SIGTSTP, collstop);
|
||||
savettou = signal(SIGTTOU, collstop);
|
||||
savettin = signal(SIGTTIN, collstop);
|
||||
if (setjmp(collabort) || setjmp(colljmp)) {
|
||||
if (sigsetjmp(collabort, 1) || sigsetjmp(colljmp, 1)) {
|
||||
rm(tempMail);
|
||||
goto err;
|
||||
}
|
||||
@ -130,14 +130,14 @@ collect(hp, printheaders)
|
||||
*/
|
||||
t = GTO|GSUBJECT|GCC|GNL;
|
||||
getsub = 0;
|
||||
if (hp->h_subject == NOSTR && value("interactive") != NOSTR &&
|
||||
(value("ask") != NOSTR || value("asksub") != NOSTR))
|
||||
if (hp->h_subject == NULL && value("interactive") != NULL &&
|
||||
(value("ask") != NULL || value("asksub") != NULL))
|
||||
t &= ~GNL, getsub++;
|
||||
if (printheaders) {
|
||||
puthead(hp, stdout, t);
|
||||
fflush(stdout);
|
||||
}
|
||||
if ((cp = value("escape")) != NOSTR)
|
||||
if ((cp = value("escape")) != NULL)
|
||||
escape = *cp;
|
||||
else
|
||||
escape = ESCAPE;
|
||||
@ -146,7 +146,7 @@ collect(hp, printheaders)
|
||||
lastlong = 0;
|
||||
longline = 0;
|
||||
|
||||
if (!setjmp(colljmp)) {
|
||||
if (!sigsetjmp(colljmp, 1)) {
|
||||
if (getsub)
|
||||
grabh(hp, GSUBJECT);
|
||||
} else {
|
||||
@ -172,8 +172,8 @@ cont:
|
||||
c = readline(stdin, linebuf, LINESIZE);
|
||||
colljmp_p = 0;
|
||||
if (c < 0) {
|
||||
if (value("interactive") != NOSTR &&
|
||||
value("ignoreeof") != NOSTR && ++eofcount < 25) {
|
||||
if (value("interactive") != NULL &&
|
||||
value("ignoreeof") != NULL && ++eofcount < 25) {
|
||||
puts("Use \".\" to terminate letter");
|
||||
continue;
|
||||
}
|
||||
@ -184,10 +184,10 @@ cont:
|
||||
eofcount = 0;
|
||||
hadintr = 0;
|
||||
if (linebuf[0] == '.' && linebuf[1] == '\0' &&
|
||||
value("interactive") != NOSTR && !lastlong &&
|
||||
(value("dot") != NOSTR || value("ignoreeof") != NOSTR))
|
||||
value("interactive") != NULL && !lastlong &&
|
||||
(value("dot") != NULL || value("ignoreeof") != NULL))
|
||||
break;
|
||||
if (linebuf[0] != escape || value("interactive") == NOSTR ||
|
||||
if (linebuf[0] != escape || value("interactive") == NULL ||
|
||||
lastlong) {
|
||||
if (putline(collf, linebuf, !longline) < 0)
|
||||
goto err;
|
||||
@ -292,7 +292,7 @@ cont:
|
||||
break;
|
||||
}
|
||||
cp = expand(cp);
|
||||
if (cp == NOSTR)
|
||||
if (cp == NULL)
|
||||
break;
|
||||
if (isdir(cp)) {
|
||||
printf("%s: Directory\n", cp);
|
||||
@ -330,7 +330,7 @@ cont:
|
||||
fputs("Write what file!?\n", stderr);
|
||||
break;
|
||||
}
|
||||
if ((cp = expand(cp)) == NOSTR)
|
||||
if ((cp = expand(cp)) == NULL)
|
||||
break;
|
||||
rewind(collf);
|
||||
exwrite(cp, collf, 1);
|
||||
@ -434,7 +434,7 @@ exwrite(name, fp, f)
|
||||
return(-1);
|
||||
}
|
||||
if ((of = Fopen(name, "w")) == NULL) {
|
||||
warn(NOSTR);
|
||||
warn(NULL);
|
||||
return(-1);
|
||||
}
|
||||
lc = 0;
|
||||
@ -501,10 +501,10 @@ mespipe(fp, cmd)
|
||||
* stdin = current message.
|
||||
* stdout = new message.
|
||||
*/
|
||||
if ((shell = value("SHELL")) == NOSTR)
|
||||
if ((shell = value("SHELL")) == NULL)
|
||||
shell = _PATH_CSHELL;
|
||||
if (run_command(shell,
|
||||
0, fileno(fp), fileno(nf), "-c", cmd, NOSTR) < 0) {
|
||||
0, fileno(fp), fileno(nf), "-c", cmd, NULL) < 0) {
|
||||
(void)Fclose(nf);
|
||||
goto out;
|
||||
}
|
||||
@ -543,7 +543,7 @@ forward(ms, fp, f)
|
||||
char *tabst;
|
||||
|
||||
msgvec = (int *)salloc((msgCount+1) * sizeof(*msgvec));
|
||||
if (msgvec == (int *)NOSTR)
|
||||
if (msgvec == NULL)
|
||||
return(0);
|
||||
if (getmsglist(ms, msgvec, 0) < 0)
|
||||
return(0);
|
||||
@ -556,8 +556,8 @@ forward(ms, fp, f)
|
||||
msgvec[1] = NULL;
|
||||
}
|
||||
if (f == 'f' || f == 'F')
|
||||
tabst = NOSTR;
|
||||
else if ((tabst = value("indentprefix")) == NOSTR)
|
||||
tabst = NULL;
|
||||
else if ((tabst = value("indentprefix")) == NULL)
|
||||
tabst = "\t";
|
||||
ig = isupper(f) ? NULL : ignore;
|
||||
fputs("Interpolating:", stdout);
|
||||
@ -595,7 +595,7 @@ collstop(s)
|
||||
if (colljmp_p) {
|
||||
colljmp_p = 0;
|
||||
hadintr = 0;
|
||||
longjmp(colljmp, 1);
|
||||
siglongjmp(colljmp, 1);
|
||||
}
|
||||
}
|
||||
|
||||
@ -612,19 +612,19 @@ collint(s)
|
||||
* the control flow is subtle, because we can be called from ~q.
|
||||
*/
|
||||
if (hadintr == 0 && isatty(0)) {
|
||||
if (value("ignore") != NOSTR) {
|
||||
if (value("ignore") != NULL) {
|
||||
puts("@");
|
||||
fflush(stdout);
|
||||
clearerr(stdin);
|
||||
return;
|
||||
}
|
||||
hadintr = 1;
|
||||
longjmp(colljmp, 1);
|
||||
siglongjmp(colljmp, 1);
|
||||
}
|
||||
rewind(collf);
|
||||
if (value("nosave") == NOSTR)
|
||||
if (value("nosave") == NULL)
|
||||
savedeadletter(collf);
|
||||
longjmp(collabort, 1);
|
||||
siglongjmp(collabort, 1);
|
||||
}
|
||||
|
||||
/*ARGSUSED*/
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: def.h,v 1.5 1997/07/13 21:21:10 millert Exp $ */
|
||||
/* $OpenBSD: def.h,v 1.6 1997/07/14 00:24:26 millert Exp $ */
|
||||
/* $NetBSD: def.h,v 1.9 1996/12/28 07:11:00 tls Exp $ */
|
||||
/*
|
||||
* Copyright (c) 1980, 1993
|
||||
@ -33,7 +33,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)def.h 8.4 (Berkeley) 4/20/95
|
||||
* $OpenBSD: def.h,v 1.5 1997/07/13 21:21:10 millert Exp $
|
||||
* $OpenBSD: def.h,v 1.6 1997/07/14 00:24:26 millert Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -65,7 +65,6 @@
|
||||
#define LINESIZE BUFSIZ /* max readable line width */
|
||||
#define STRINGSIZE ((unsigned) 128)/* Dynamic allocation units */
|
||||
#define MAXARGC 1024 /* Maximum list of raw strings */
|
||||
#define NOSTR ((char *) 0) /* Null string pointer */
|
||||
#define MAXEXP 25 /* Maximum expansion of aliases */
|
||||
|
||||
#define equal(a, b) (strcmp(a,b)==0)/* A nice function to string compare */
|
||||
@ -263,11 +262,11 @@ struct ignoretab {
|
||||
#define CSEND 2 /* Execute in send mode only */
|
||||
|
||||
/*
|
||||
* Kludges to handle the change from setexit / reset to setjmp / longjmp
|
||||
* Kludges to handle the change from setexit / reset to sigsetjmp / siglongjmp
|
||||
*/
|
||||
|
||||
#define setexit() setjmp(srbuf)
|
||||
#define reset(x) longjmp(srbuf, x)
|
||||
#define setexit() sigsetjmp(srbuf, 1)
|
||||
#define reset(x) siglongjmp(srbuf, x)
|
||||
|
||||
/*
|
||||
* Truncate a file to the last character written. This is
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: edit.c,v 1.4 1997/07/13 23:53:59 millert Exp $ */
|
||||
/* $OpenBSD: edit.c,v 1.5 1997/07/14 00:24:26 millert Exp $ */
|
||||
/* $NetBSD: edit.c,v 1.5 1996/06/08 19:48:20 christos Exp $ */
|
||||
|
||||
/*
|
||||
@ -38,7 +38,7 @@
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)edit.c 8.1 (Berkeley) 6/6/93";
|
||||
#else
|
||||
static char rcsid[] = "$OpenBSD: edit.c,v 1.4 1997/07/13 23:53:59 millert Exp $";
|
||||
static char rcsid[] = "$OpenBSD: edit.c,v 1.5 1997/07/14 00:24:26 millert Exp $";
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
@ -193,9 +193,9 @@ run_editor(fp, size, type, readonly)
|
||||
goto out;
|
||||
}
|
||||
nf = NULL;
|
||||
if ((edit = value(type == 'e' ? "EDITOR" : "VISUAL")) == NOSTR)
|
||||
if ((edit = value(type == 'e' ? "EDITOR" : "VISUAL")) == NULL)
|
||||
edit = type == 'e' ? _PATH_EX : _PATH_VI;
|
||||
if (run_command(edit, 0, -1, -1, tempEdit, NOSTR, NOSTR) < 0) {
|
||||
if (run_command(edit, 0, -1, -1, tempEdit, NULL, NULL) < 0) {
|
||||
(void)unlink(tempEdit);
|
||||
goto out;
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: fio.c,v 1.7 1997/07/13 23:53:59 millert Exp $ */
|
||||
/* $OpenBSD: fio.c,v 1.8 1997/07/14 00:24:26 millert Exp $ */
|
||||
/* $NetBSD: fio.c,v 1.8 1997/07/07 22:57:55 phil Exp $ */
|
||||
|
||||
/*
|
||||
@ -38,7 +38,7 @@
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)fio.c 8.2 (Berkeley) 4/20/95";
|
||||
#else
|
||||
static char rcsid[] = "$OpenBSD: fio.c,v 1.7 1997/07/13 23:53:59 millert Exp $";
|
||||
static char rcsid[] = "$OpenBSD: fio.c,v 1.8 1997/07/14 00:24:26 millert Exp $";
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
@ -360,11 +360,11 @@ expand(name)
|
||||
break;
|
||||
if (prevfile[0] == 0) {
|
||||
puts("No previous file");
|
||||
return(NOSTR);
|
||||
return(NULL);
|
||||
}
|
||||
return(savestr(prevfile));
|
||||
case '&':
|
||||
if (name[1] == 0 && (name = value("MBOX")) == NOSTR)
|
||||
if (name[1] == 0 && (name = value("MBOX")) == NULL)
|
||||
name = "~/mbox";
|
||||
/* fall through */
|
||||
}
|
||||
@ -384,32 +384,32 @@ expand(name)
|
||||
return(name);
|
||||
}
|
||||
snprintf(cmdbuf, sizeof(cmdbuf), "echo %s", name);
|
||||
if ((shell = value("SHELL")) == NOSTR)
|
||||
if ((shell = value("SHELL")) == NULL)
|
||||
shell = _PATH_CSHELL;
|
||||
pid = start_command(shell, 0, -1, pivec[1], "-c", cmdbuf, NOSTR);
|
||||
pid = start_command(shell, 0, -1, pivec[1], "-c", cmdbuf, NULL);
|
||||
if (pid < 0) {
|
||||
(void)close(pivec[0]);
|
||||
(void)close(pivec[1]);
|
||||
return(NOSTR);
|
||||
return(NULL);
|
||||
}
|
||||
(void)close(pivec[1]);
|
||||
l = read(pivec[0], xname, PATHSIZE);
|
||||
(void)close(pivec[0]);
|
||||
if (wait_child(pid) < 0 && wait_status.w_termsig != SIGPIPE) {
|
||||
fprintf(stderr, "\"%s\": Expansion failed.\n", name);
|
||||
return(NOSTR);
|
||||
return(NULL);
|
||||
}
|
||||
if (l < 0) {
|
||||
warn("read");
|
||||
return(NOSTR);
|
||||
return(NULL);
|
||||
}
|
||||
if (l == 0) {
|
||||
fprintf(stderr, "\"%s\": No match.\n", name);
|
||||
return(NOSTR);
|
||||
return(NULL);
|
||||
}
|
||||
if (l == PATHSIZE) {
|
||||
fprintf(stderr, "\"%s\": Expansion buffer overflow.\n", name);
|
||||
return(NOSTR);
|
||||
return(NULL);
|
||||
}
|
||||
xname[l] = '\0';
|
||||
for (cp = &xname[l-1]; *cp == '\n' && cp > xname; cp--)
|
||||
@ -417,7 +417,7 @@ expand(name)
|
||||
cp[1] = '\0';
|
||||
if (strchr(xname, ' ') && stat(xname, &sbuf) < 0) {
|
||||
fprintf(stderr, "\"%s\": Ambiguous.\n", name);
|
||||
return(NOSTR);
|
||||
return(NULL);
|
||||
}
|
||||
return(savestr(xname));
|
||||
}
|
||||
@ -432,7 +432,7 @@ getfold(name, namelen)
|
||||
{
|
||||
char *folder;
|
||||
|
||||
if ((folder = value("folder")) == NOSTR)
|
||||
if ((folder = value("folder")) == NULL)
|
||||
return(-1);
|
||||
if (*folder == '/') {
|
||||
strncpy(name, folder, namelen-1);
|
||||
@ -450,7 +450,7 @@ getdeadletter()
|
||||
{
|
||||
register char *cp;
|
||||
|
||||
if ((cp = value("DEAD")) == NOSTR || (cp = expand(cp)) == NOSTR)
|
||||
if ((cp = value("DEAD")) == NULL || (cp = expand(cp)) == NULL)
|
||||
cp = expand("~/dead.letter");
|
||||
else if (*cp != '/') {
|
||||
char buf[PATHSIZE];
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: getname.c,v 1.3 1997/07/13 21:21:13 millert Exp $ */
|
||||
/* $OpenBSD: getname.c,v 1.4 1997/07/14 00:24:27 millert Exp $ */
|
||||
/* $NetBSD: getname.c,v 1.4 1996/06/08 19:48:23 christos Exp $ */
|
||||
|
||||
/*
|
||||
@ -38,7 +38,7 @@
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)getname.c 8.1 (Berkeley) 6/6/93";
|
||||
#else
|
||||
static char rcsid[] = "$OpenBSD: getname.c,v 1.3 1997/07/13 21:21:13 millert Exp $";
|
||||
static char rcsid[] = "$OpenBSD: getname.c,v 1.4 1997/07/14 00:24:27 millert Exp $";
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
@ -49,7 +49,7 @@ static char rcsid[] = "$OpenBSD: getname.c,v 1.3 1997/07/13 21:21:13 millert Exp
|
||||
/* Getname / getuserid for those with hashed passwd data base). */
|
||||
|
||||
/*
|
||||
* Search the passwd file for a uid. Return name on success, NOSTR on failure
|
||||
* Search the passwd file for a uid. Return name on success, NULL on failure
|
||||
*/
|
||||
char *
|
||||
getname(uid)
|
||||
@ -58,7 +58,7 @@ getname(uid)
|
||||
struct passwd *pw;
|
||||
|
||||
if ((pw = getpwuid(uid)) == NULL)
|
||||
return(NOSTR);
|
||||
return(NULL);
|
||||
return(pw->pw_name);
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: head.c,v 1.3 1997/07/13 21:21:13 millert Exp $ */
|
||||
/* $OpenBSD: head.c,v 1.4 1997/07/14 00:24:27 millert Exp $ */
|
||||
/* $NetBSD: head.c,v 1.6 1996/12/28 07:11:03 tls Exp $ */
|
||||
|
||||
/*
|
||||
@ -38,7 +38,7 @@
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)head.c 8.2 (Berkeley) 4/20/95";
|
||||
#else
|
||||
static char rcsid[] = "$OpenBSD: head.c,v 1.3 1997/07/13 21:21:13 millert Exp $";
|
||||
static char rcsid[] = "$OpenBSD: head.c,v 1.4 1997/07/14 00:24:27 millert Exp $";
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
@ -69,7 +69,7 @@ ishead(linebuf)
|
||||
*cp++ != ' ')
|
||||
return(0);
|
||||
parse(linebuf, &hl, parbuf);
|
||||
if (hl.l_from == NOSTR || hl.l_date == NOSTR) {
|
||||
if (hl.l_from == NULL || hl.l_date == NULL) {
|
||||
fail(linebuf, "No from or date field");
|
||||
return(0);
|
||||
}
|
||||
@ -90,7 +90,7 @@ fail(linebuf, reason)
|
||||
{
|
||||
|
||||
/*
|
||||
if (value("debug") == NOSTR)
|
||||
if (value("debug") == NULL)
|
||||
return;
|
||||
fprintf(stderr, "\"%s\"\nnot a header because %s\n", linebuf, reason);
|
||||
*/
|
||||
@ -111,9 +111,9 @@ parse(line, hl, pbuf)
|
||||
char *sp;
|
||||
char word[LINESIZE];
|
||||
|
||||
hl->l_from = NOSTR;
|
||||
hl->l_tty = NOSTR;
|
||||
hl->l_date = NOSTR;
|
||||
hl->l_from = NULL;
|
||||
hl->l_tty = NULL;
|
||||
hl->l_date = NULL;
|
||||
cp = line;
|
||||
sp = pbuf;
|
||||
/*
|
||||
@ -123,11 +123,11 @@ parse(line, hl, pbuf)
|
||||
cp = nextword(cp, word);
|
||||
if (*word)
|
||||
hl->l_from = copyin(word, &sp);
|
||||
if (cp != NOSTR && cp[0] == 't' && cp[1] == 't' && cp[2] == 'y') {
|
||||
if (cp != NULL && cp[0] == 't' && cp[1] == 't' && cp[2] == 'y') {
|
||||
cp = nextword(cp, word);
|
||||
hl->l_tty = copyin(word, &sp);
|
||||
}
|
||||
if (cp != NOSTR)
|
||||
if (cp != NULL)
|
||||
hl->l_date = copyin(cp, &sp);
|
||||
}
|
||||
|
||||
@ -236,7 +236,7 @@ cmatch(cp, tp)
|
||||
/*
|
||||
* Collect a liberal (space, tab delimited) word into the word buffer
|
||||
* passed. Also, return a pointer to the next word following that,
|
||||
* or NOSTR if none follow.
|
||||
* or NULL if none follow.
|
||||
*/
|
||||
char *
|
||||
nextword(wp, wbuf)
|
||||
@ -244,9 +244,9 @@ nextword(wp, wbuf)
|
||||
{
|
||||
register c;
|
||||
|
||||
if (wp == NOSTR) {
|
||||
if (wp == NULL) {
|
||||
*wbuf = 0;
|
||||
return(NOSTR);
|
||||
return(NULL);
|
||||
}
|
||||
while ((c = *wp++) && c != ' ' && c != '\t') {
|
||||
*wbuf++ = c;
|
||||
@ -263,6 +263,6 @@ nextword(wp, wbuf)
|
||||
for (; c == ' ' || c == '\t'; c = *wp++)
|
||||
;
|
||||
if (c == 0)
|
||||
return(NOSTR);
|
||||
return(NULL);
|
||||
return(wp - 1);
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: lex.c,v 1.7 1997/07/13 23:54:00 millert Exp $ */
|
||||
/* $OpenBSD: lex.c,v 1.8 1997/07/14 00:24:27 millert Exp $ */
|
||||
/* $NetBSD: lex.c,v 1.10 1997/05/17 19:55:13 pk Exp $ */
|
||||
|
||||
/*
|
||||
@ -38,7 +38,7 @@
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)lex.c 8.2 (Berkeley) 4/20/95";
|
||||
#else
|
||||
static char rcsid[] = "$OpenBSD: lex.c,v 1.7 1997/07/13 23:54:00 millert Exp $";
|
||||
static char rcsid[] = "$OpenBSD: lex.c,v 1.8 1997/07/14 00:24:27 millert Exp $";
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
@ -74,7 +74,7 @@ setfile(name)
|
||||
extern char *tempMesg;
|
||||
extern int errno;
|
||||
|
||||
if ((name = expand(name)) == NOSTR)
|
||||
if ((name = expand(name)) == NULL)
|
||||
return(-1);
|
||||
|
||||
if ((ibuf = Fopen(name, "r")) == NULL) {
|
||||
@ -209,7 +209,7 @@ commands()
|
||||
register int n;
|
||||
char linebuf[LINESIZE];
|
||||
#if __GNUC__
|
||||
/* Avoid longjmp clobbering */
|
||||
/* Avoid siglongjmp clobbering */
|
||||
(void)&eofloop;
|
||||
#endif
|
||||
|
||||
@ -228,8 +228,8 @@ commands()
|
||||
* Print the prompt, if needed. Clear out
|
||||
* string space, and flush the output.
|
||||
*/
|
||||
if (!sourcing && value("interactive") != NOSTR) {
|
||||
if ((value("autoinc") != NOSTR) && (incfile() > 0))
|
||||
if (!sourcing && value("interactive") != NULL) {
|
||||
if ((value("autoinc") != NULL) && (incfile() > 0))
|
||||
puts("New mail has arrived.");
|
||||
reset_on_stop = 1;
|
||||
printf(prompt);
|
||||
@ -263,8 +263,8 @@ commands()
|
||||
unstack();
|
||||
continue;
|
||||
}
|
||||
if (value("interactive") != NOSTR &&
|
||||
value("ignoreeof") != NOSTR &&
|
||||
if (value("interactive") != NULL &&
|
||||
value("ignoreeof") != NULL &&
|
||||
++eofloop < 25) {
|
||||
puts("Use \"quit\" to quit.");
|
||||
continue;
|
||||
@ -317,7 +317,7 @@ execute(linebuf, contxt)
|
||||
return(0);
|
||||
}
|
||||
cp2 = word;
|
||||
while (*cp && strchr(" \t0123456789$^.:/-+*'\"", *cp) == NOSTR)
|
||||
while (*cp && strchr(" \t0123456789$^.:/-+*'\"", *cp) == NULL)
|
||||
*cp2++ = *cp++;
|
||||
*cp2 = '\0';
|
||||
|
||||
@ -468,7 +468,7 @@ out:
|
||||
}
|
||||
if (com == NULL)
|
||||
return(0);
|
||||
if (value("autoprint") != NOSTR && com->c_argtype & P)
|
||||
if (value("autoprint") != NULL && com->c_argtype & P)
|
||||
if ((dot->m_flag & MDELETED) == 0) {
|
||||
muvec[0] = dot - &message[0] + 1;
|
||||
muvec[1] = 0;
|
||||
@ -505,7 +505,7 @@ lex(word)
|
||||
extern const struct cmd cmdtab[];
|
||||
register const struct cmd *cp;
|
||||
|
||||
for (cp = &cmdtab[0]; cp->c_name != NOSTR; cp++)
|
||||
for (cp = &cmdtab[0]; cp->c_name != NULL; cp++)
|
||||
if (isprefix(word, cp->c_name))
|
||||
return(cp);
|
||||
return(NONE);
|
||||
@ -610,7 +610,7 @@ announce()
|
||||
vec[0] = mdot;
|
||||
vec[1] = 0;
|
||||
dot = &message[mdot - 1];
|
||||
if (msgCount > 0 && value("noheader") == NOSTR) {
|
||||
if (msgCount > 0 && value("noheader") == NULL) {
|
||||
inithdr++;
|
||||
headers(vec);
|
||||
inithdr = 0;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: list.c,v 1.5 1997/07/13 21:21:14 millert Exp $ */
|
||||
/* $OpenBSD: list.c,v 1.6 1997/07/14 00:24:28 millert Exp $ */
|
||||
/* $NetBSD: list.c,v 1.7 1997/07/09 05:23:36 mikel Exp $ */
|
||||
|
||||
/*
|
||||
@ -38,7 +38,7 @@
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)list.c 8.4 (Berkeley) 5/1/95";
|
||||
#else
|
||||
static char rcsid[] = "$OpenBSD: list.c,v 1.5 1997/07/13 21:21:14 millert Exp $";
|
||||
static char rcsid[] = "$OpenBSD: list.c,v 1.6 1997/07/14 00:24:28 millert Exp $";
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
@ -241,7 +241,7 @@ number:
|
||||
tok = scan(&bufp);
|
||||
}
|
||||
lastcolmod = colmod;
|
||||
*np = NOSTR;
|
||||
*np = NULL;
|
||||
mc = 0;
|
||||
if (star) {
|
||||
for (i = 0; i < msgCount; i++)
|
||||
@ -274,7 +274,7 @@ number:
|
||||
|
||||
if (np > namelist) {
|
||||
for (i = 1; i <= msgCount; i++) {
|
||||
for (mc = 0, np = &namelist[0]; *np != NOSTR; np++)
|
||||
for (mc = 0, np = &namelist[0]; *np != NULL; np++)
|
||||
if (**np == '/') {
|
||||
if (matchsubj(*np, i)) {
|
||||
mc++;
|
||||
@ -304,7 +304,7 @@ number:
|
||||
if (mc == 0) {
|
||||
printf("No applicable messages from {%s",
|
||||
namelist[0]);
|
||||
for (np = &namelist[1]; *np != NOSTR; np++)
|
||||
for (np = &namelist[1]; *np != NULL; np++)
|
||||
printf(", %s", *np);
|
||||
puts("}");
|
||||
return(-1);
|
||||
@ -478,7 +478,7 @@ getrawlist(line, argv, argc)
|
||||
*cp2 = '\0';
|
||||
argv[argn++] = savestr(linebuf);
|
||||
}
|
||||
argv[argn] = NOSTR;
|
||||
argv[argn] = NULL;
|
||||
return(argn);
|
||||
}
|
||||
|
||||
@ -700,7 +700,7 @@ matchto(str, mesg)
|
||||
for (to = to_fields; *to; to++) {
|
||||
cp = str;
|
||||
cp2 = hfield(*to, mp);
|
||||
if (cp2 != NOSTR) {
|
||||
if (cp2 != NULL) {
|
||||
backup = cp2;
|
||||
while (*cp2) {
|
||||
if (*cp == 0)
|
||||
@ -760,7 +760,7 @@ matchsubj(str, mesg)
|
||||
cp = str;
|
||||
cp2 = hfield("subject", mp);
|
||||
}
|
||||
if (cp2 == NOSTR)
|
||||
if (cp2 == NULL)
|
||||
return(0);
|
||||
backup = cp2;
|
||||
while (*cp2) {
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: main.c,v 1.6 1997/07/13 23:54:00 millert Exp $ */
|
||||
/* $OpenBSD: main.c,v 1.7 1997/07/14 00:24:28 millert Exp $ */
|
||||
/* $NetBSD: main.c,v 1.7 1997/05/13 06:15:57 mikel Exp $ */
|
||||
|
||||
/*
|
||||
@ -44,7 +44,7 @@ static char copyright[] =
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)main.c 8.2 (Berkeley) 4/20/95";
|
||||
#else
|
||||
static char rcsid[] = "$OpenBSD: main.c,v 1.6 1997/07/13 23:54:00 millert Exp $";
|
||||
static char rcsid[] = "$OpenBSD: main.c,v 1.7 1997/07/14 00:24:28 millert Exp $";
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
@ -59,7 +59,7 @@ static char rcsid[] = "$OpenBSD: main.c,v 1.6 1997/07/13 23:54:00 millert Exp $"
|
||||
* Startup -- interface with user.
|
||||
*/
|
||||
|
||||
jmp_buf hdrjmp;
|
||||
sigjmp_buf hdrjmp;
|
||||
|
||||
int
|
||||
main(argc, argv)
|
||||
@ -90,12 +90,12 @@ main(argc, argv)
|
||||
* of users to mail to. Argp will be set to point to the
|
||||
* first of these users.
|
||||
*/
|
||||
ef = NOSTR;
|
||||
ef = NULL;
|
||||
to = NIL;
|
||||
cc = NIL;
|
||||
bcc = NIL;
|
||||
smopts = NIL;
|
||||
subject = NOSTR;
|
||||
subject = NULL;
|
||||
while ((i = getopt(argc, argv, "INT:b:c:dfins:u:v")) != -1) {
|
||||
switch (i) {
|
||||
case 'T':
|
||||
@ -199,9 +199,9 @@ Usage: %s [-iInv] [-s subject] [-c cc-addr] [-b bcc-addr] to-addr ...\n\
|
||||
/*
|
||||
* Check for inconsistent arguments.
|
||||
*/
|
||||
if (to == NIL && (subject != NOSTR || cc != NIL || bcc != NIL))
|
||||
if (to == NIL && (subject != NULL || cc != NIL || bcc != NIL))
|
||||
errx(1, "You must specify direct recipients with -s, -c, or -b");
|
||||
if (ef != NOSTR && to != NIL)
|
||||
if (ef != NULL && to != NIL)
|
||||
errx(1, "Cannot give -f and people to send to");
|
||||
tinit();
|
||||
setscreensize();
|
||||
@ -229,16 +229,16 @@ Usage: %s [-iInv] [-s subject] [-c cc-addr] [-b bcc-addr] to-addr ...\n\
|
||||
* Decide whether we are editing a mailbox or reading
|
||||
* the system mailbox, and open up the right stuff.
|
||||
*/
|
||||
if (ef == NOSTR)
|
||||
if (ef == NULL)
|
||||
ef = "%";
|
||||
if (setfile(ef) < 0)
|
||||
exit(1); /* error already reported */
|
||||
if (setjmp(hdrjmp) == 0) {
|
||||
if (sigsetjmp(hdrjmp, 1) == 0) {
|
||||
extern char *version;
|
||||
|
||||
if ((prevint = signal(SIGINT, SIG_IGN)) != SIG_IGN)
|
||||
signal(SIGINT, hdrstop);
|
||||
if (value("quiet") == NOSTR)
|
||||
if (value("quiet") == NULL)
|
||||
printf("Mail version %s. Type ? for help.\n",
|
||||
version);
|
||||
announce();
|
||||
@ -263,7 +263,7 @@ hdrstop(signo)
|
||||
|
||||
fflush(stdout);
|
||||
fputs("\nInterrupt\n", stderr);
|
||||
longjmp(hdrjmp, 1);
|
||||
siglongjmp(hdrjmp, 1);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: names.c,v 1.5 1997/07/13 23:54:01 millert Exp $ */
|
||||
/* $OpenBSD: names.c,v 1.6 1997/07/14 00:24:29 millert Exp $ */
|
||||
/* $NetBSD: names.c,v 1.5 1996/06/08 19:48:32 christos Exp $ */
|
||||
|
||||
/*
|
||||
@ -38,7 +38,7 @@
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)names.c 8.1 (Berkeley) 6/6/93";
|
||||
#else
|
||||
static char rcsid[] = "$OpenBSD: names.c,v 1.5 1997/07/13 23:54:01 millert Exp $";
|
||||
static char rcsid[] = "$OpenBSD: names.c,v 1.6 1997/07/14 00:24:29 millert Exp $";
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
@ -103,12 +103,12 @@ extract(line, ntype)
|
||||
register struct name *top, *np, *t;
|
||||
char nbuf[BUFSIZ];
|
||||
|
||||
if (line == NOSTR || *line == '\0')
|
||||
if (line == NULL || *line == '\0')
|
||||
return(NIL);
|
||||
top = NIL;
|
||||
np = NIL;
|
||||
cp = line;
|
||||
while ((cp = yankword(cp, nbuf)) != NOSTR) {
|
||||
while ((cp = yankword(cp, nbuf)) != NULL) {
|
||||
t = nalloc(nbuf, ntype);
|
||||
if (top == NIL)
|
||||
top = t;
|
||||
@ -135,7 +135,7 @@ detract(np, ntype)
|
||||
|
||||
comma = ntype & GCOMMA;
|
||||
if (np == NIL)
|
||||
return(NOSTR);
|
||||
return(NULL);
|
||||
ntype &= ~GCOMMA;
|
||||
s = 0;
|
||||
if (debug && comma)
|
||||
@ -148,7 +148,7 @@ detract(np, ntype)
|
||||
s++;
|
||||
}
|
||||
if (s == 0)
|
||||
return(NOSTR);
|
||||
return(NULL);
|
||||
s += 2;
|
||||
top = salloc(s);
|
||||
cp = top;
|
||||
@ -179,7 +179,7 @@ yankword(ap, wbuf)
|
||||
cp = ap;
|
||||
for (;;) {
|
||||
if (*cp == '\0')
|
||||
return(NOSTR);
|
||||
return(NULL);
|
||||
if (*cp == '(') {
|
||||
register int nesting = 0;
|
||||
|
||||
@ -297,14 +297,14 @@ outof(names, fo, hp)
|
||||
* share the same lseek location and trample
|
||||
* on one another.
|
||||
*/
|
||||
if ((shell = value("SHELL")) == NOSTR)
|
||||
if ((shell = value("SHELL")) == NULL)
|
||||
shell = _PATH_CSHELL;
|
||||
sigemptyset(&nset);
|
||||
sigaddset(&nset, SIGHUP);
|
||||
sigaddset(&nset, SIGINT);
|
||||
sigaddset(&nset, SIGQUIT);
|
||||
pid = start_command(shell, &nset,
|
||||
image, -1, "-c", fname, NOSTR);
|
||||
image, -1, "-c", fname, NULL);
|
||||
if (pid < 0) {
|
||||
senderr++;
|
||||
goto cant;
|
||||
@ -393,7 +393,7 @@ usermap(names)
|
||||
|
||||
new = NIL;
|
||||
np = names;
|
||||
metoo = (value("metoo") != NOSTR);
|
||||
metoo = (value("metoo") != NULL);
|
||||
while (np != NIL) {
|
||||
if (np->n_name[0] == '\\') {
|
||||
cp = np->n_flink;
|
||||
@ -504,10 +504,10 @@ unpack(np)
|
||||
*/
|
||||
extra = 2;
|
||||
extra++;
|
||||
metoo = value("metoo") != NOSTR;
|
||||
metoo = value("metoo") != NULL;
|
||||
if (metoo)
|
||||
extra++;
|
||||
verbose = value("verbose") != NOSTR;
|
||||
verbose = value("verbose") != NULL;
|
||||
if (verbose)
|
||||
extra++;
|
||||
top = (char **)salloc((t + extra) * sizeof(*top));
|
||||
@ -521,7 +521,7 @@ unpack(np)
|
||||
for (; n != NIL; n = n->n_flink)
|
||||
if ((n->n_type & GDEL) == 0)
|
||||
*ap++ = n->n_name;
|
||||
*ap = NOSTR;
|
||||
*ap = NULL;
|
||||
return(top);
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: popen.c,v 1.7 1997/07/13 23:54:01 millert Exp $ */
|
||||
/* $OpenBSD: popen.c,v 1.8 1997/07/14 00:24:29 millert Exp $ */
|
||||
/* $NetBSD: popen.c,v 1.6 1997/05/13 06:48:42 mikel Exp $ */
|
||||
|
||||
/*
|
||||
@ -38,7 +38,7 @@
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)popen.c 8.1 (Berkeley) 6/6/93";
|
||||
#else
|
||||
static char rcsid[] = "$OpenBSD: popen.c,v 1.7 1997/07/13 23:54:01 millert Exp $";
|
||||
static char rcsid[] = "$OpenBSD: popen.c,v 1.8 1997/07/14 00:24:29 millert Exp $";
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
@ -131,7 +131,7 @@ Popen(cmd, mode)
|
||||
fd1 = -1;
|
||||
}
|
||||
sigemptyset(&nset);
|
||||
if ((pid = start_command(cmd, &nset, fd0, fd1, NOSTR, NOSTR, NOSTR)) < 0) {
|
||||
if ((pid = start_command(cmd, &nset, fd0, fd1, NULL, NULL, NULL)) < 0) {
|
||||
(void)close(p[READ]);
|
||||
(void)close(p[WRITE]);
|
||||
return(NULL);
|
||||
@ -256,10 +256,10 @@ start_command(cmd, mask, infd, outfd, a0, a1, a2)
|
||||
char *argv[100];
|
||||
int i = getrawlist(cmd, argv, sizeof(argv)/ sizeof(*argv));
|
||||
|
||||
if ((argv[i++] = a0) != NOSTR &&
|
||||
(argv[i++] = a1) != NOSTR &&
|
||||
(argv[i++] = a2) != NOSTR)
|
||||
argv[i] = NOSTR;
|
||||
if ((argv[i++] = a0) != NULL &&
|
||||
(argv[i++] = a1) != NULL &&
|
||||
(argv[i++] = a2) != NULL)
|
||||
argv[i] = NULL;
|
||||
prepare_child(mask, infd, outfd);
|
||||
execvp(argv[0], argv);
|
||||
warn(argv[0]);
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: quit.c,v 1.5 1997/07/13 23:54:02 millert Exp $ */
|
||||
/* $OpenBSD: quit.c,v 1.6 1997/07/14 00:24:29 millert Exp $ */
|
||||
/* $NetBSD: quit.c,v 1.6 1996/12/28 07:11:07 tls Exp $ */
|
||||
|
||||
/*
|
||||
@ -38,7 +38,7 @@
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)quit.c 8.2 (Berkeley) 4/28/95";
|
||||
#else
|
||||
static char rcsid[] = "$OpenBSD: quit.c,v 1.5 1997/07/13 23:54:02 millert Exp $";
|
||||
static char rcsid[] = "$OpenBSD: quit.c,v 1.6 1997/07/14 00:24:29 millert Exp $";
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
@ -151,10 +151,10 @@ quit()
|
||||
*/
|
||||
|
||||
anystat = 0;
|
||||
autohold = value("hold") != NOSTR;
|
||||
autohold = value("hold") != NULL;
|
||||
holdbit = autohold ? MPRESERVE : MBOX;
|
||||
nohold = MBOX|MSAVED|MDELETED|MPRESERVE;
|
||||
if (value("keepsave") != NOSTR)
|
||||
if (value("keepsave") != NULL)
|
||||
nohold &= ~MSAVED;
|
||||
for (mp = &message[0]; mp < &message[msgCount]; mp++) {
|
||||
if (mp->m_flag & MNEW) {
|
||||
@ -169,9 +169,9 @@ quit()
|
||||
mp->m_flag |= holdbit;
|
||||
}
|
||||
modify = 0;
|
||||
if (Tflag != NOSTR) {
|
||||
if (Tflag != NULL) {
|
||||
if ((readstat = Fopen(Tflag, "w")) == NULL)
|
||||
Tflag = NOSTR;
|
||||
Tflag = NULL;
|
||||
}
|
||||
for (c = 0, p = 0, mp = &message[0]; mp < &message[msgCount]; mp++) {
|
||||
if (mp->m_flag & MBOX)
|
||||
@ -180,14 +180,14 @@ quit()
|
||||
p++;
|
||||
if (mp->m_flag & MODIFY)
|
||||
modify++;
|
||||
if (Tflag != NOSTR && (mp->m_flag & (MREAD|MDELETED)) != 0) {
|
||||
if (Tflag != NULL && (mp->m_flag & (MREAD|MDELETED)) != 0) {
|
||||
char *id;
|
||||
|
||||
if ((id = hfield("article-id", mp)) != NOSTR)
|
||||
if ((id = hfield("article-id", mp)) != NULL)
|
||||
fprintf(readstat, "%s\n", id);
|
||||
}
|
||||
}
|
||||
if (Tflag != NOSTR)
|
||||
if (Tflag != NULL)
|
||||
(void)Fclose(readstat);
|
||||
if (p == msgCount && !modify && !anystat) {
|
||||
printf("Held %d message%s in %s\n",
|
||||
@ -215,7 +215,7 @@ quit()
|
||||
|
||||
mbox = expand("&");
|
||||
mcount = c;
|
||||
if (value("append") == NOSTR) {
|
||||
if (value("append") == NULL) {
|
||||
if ((obuf = Fopen(tempQuit, "w")) == NULL) {
|
||||
warn(tempQuit);
|
||||
(void)Fclose(fbuf);
|
||||
@ -265,7 +265,7 @@ quit()
|
||||
}
|
||||
for (mp = &message[0]; mp < &message[msgCount]; mp++)
|
||||
if (mp->m_flag & MBOX)
|
||||
if (send(mp, obuf, saveignore, NOSTR) < 0) {
|
||||
if (send(mp, obuf, saveignore, NULL) < 0) {
|
||||
warn(mbox);
|
||||
(void)Fclose(ibuf);
|
||||
(void)Fclose(obuf);
|
||||
@ -280,7 +280,7 @@ quit()
|
||||
* If we are appending, this is unnecessary.
|
||||
*/
|
||||
|
||||
if (value("append") == NOSTR) {
|
||||
if (value("append") == NULL) {
|
||||
rewind(ibuf);
|
||||
c = getc(ibuf);
|
||||
while (c != EOF) {
|
||||
@ -378,7 +378,7 @@ writeback(res)
|
||||
for (mp = &message[0]; mp < &message[msgCount]; mp++)
|
||||
if ((mp->m_flag&MPRESERVE)||(mp->m_flag&MTOUCH)==0) {
|
||||
p++;
|
||||
if (send(mp, obuf, (struct ignoretab *)0, NOSTR) < 0) {
|
||||
if (send(mp, obuf, (struct ignoretab *)0, NULL) < 0) {
|
||||
warn(mailname);
|
||||
(void)Fclose(obuf);
|
||||
return(-1);
|
||||
@ -424,9 +424,9 @@ edstop()
|
||||
if (readonly)
|
||||
return;
|
||||
holdsigs();
|
||||
if (Tflag != NOSTR) {
|
||||
if (Tflag != NULL) {
|
||||
if ((readstat = Fopen(Tflag, "w")) == NULL)
|
||||
Tflag = NOSTR;
|
||||
Tflag = NULL;
|
||||
}
|
||||
for (mp = &message[0], gotcha = 0; mp < &message[msgCount]; mp++) {
|
||||
if (mp->m_flag & MNEW) {
|
||||
@ -435,16 +435,16 @@ edstop()
|
||||
}
|
||||
if (mp->m_flag & (MODIFY|MDELETED|MSTATUS))
|
||||
gotcha++;
|
||||
if (Tflag != NOSTR && (mp->m_flag & (MREAD|MDELETED)) != 0) {
|
||||
if (Tflag != NULL && (mp->m_flag & (MREAD|MDELETED)) != 0) {
|
||||
char *id;
|
||||
|
||||
if ((id = hfield("article-id", mp)) != NOSTR)
|
||||
if ((id = hfield("article-id", mp)) != NULL)
|
||||
fprintf(readstat, "%s\n", id);
|
||||
}
|
||||
}
|
||||
if (Tflag != NOSTR)
|
||||
if (Tflag != NULL)
|
||||
(void)Fclose(readstat);
|
||||
if (!gotcha || Tflag != NOSTR)
|
||||
if (!gotcha || Tflag != NULL)
|
||||
goto done;
|
||||
ibuf = NULL;
|
||||
if (stat(mailname, &statb) >= 0 && statb.st_size > mailsize) {
|
||||
@ -491,7 +491,7 @@ edstop()
|
||||
if ((mp->m_flag & MDELETED) != 0)
|
||||
continue;
|
||||
c++;
|
||||
if (send(mp, obuf, (struct ignoretab *) NULL, NOSTR) < 0) {
|
||||
if (send(mp, obuf, (struct ignoretab *) NULL, NULL) < 0) {
|
||||
warn(mailname);
|
||||
relsesigs();
|
||||
reset(0);
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: send.c,v 1.4 1997/07/13 23:54:02 millert Exp $ */
|
||||
/* $OpenBSD: send.c,v 1.5 1997/07/14 00:24:30 millert Exp $ */
|
||||
/* $NetBSD: send.c,v 1.6 1996/06/08 19:48:39 christos Exp $ */
|
||||
|
||||
/*
|
||||
@ -38,7 +38,7 @@
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)send.c 8.1 (Berkeley) 6/6/93";
|
||||
#else
|
||||
static char rcsid[] = "$OpenBSD: send.c,v 1.4 1997/07/13 23:54:02 millert Exp $";
|
||||
static char rcsid[] = "$OpenBSD: send.c,v 1.5 1997/07/14 00:24:30 millert Exp $";
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
@ -77,7 +77,7 @@ send(mp, obuf, doign, prefix)
|
||||
/*
|
||||
* Compute the prefix string, without trailing whitespace
|
||||
*/
|
||||
if (prefix != NOSTR) {
|
||||
if (prefix != NULL) {
|
||||
cp2 = 0;
|
||||
for (cp = prefix; *cp; cp++)
|
||||
if (*cp != ' ' && *cp != '\t')
|
||||
@ -179,7 +179,7 @@ send(mp, obuf, doign, prefix)
|
||||
* Strip trailing whitespace from prefix
|
||||
* if line is blank.
|
||||
*/
|
||||
if (prefix != NOSTR)
|
||||
if (prefix != NULL)
|
||||
if (length > 1)
|
||||
fputs(prefix, obuf);
|
||||
else
|
||||
@ -195,7 +195,7 @@ send(mp, obuf, doign, prefix)
|
||||
*/
|
||||
if (doign == ignoreall)
|
||||
count--; /* skip final blank line */
|
||||
if (prefix != NOSTR)
|
||||
if (prefix != NULL)
|
||||
while (count > 0) {
|
||||
if (fgets(line, sizeof(line), ibuf) == NULL) {
|
||||
c = 0;
|
||||
@ -250,7 +250,7 @@ statusput(mp, obuf, prefix)
|
||||
*cp = 0;
|
||||
if (statout[0])
|
||||
fprintf(obuf, "%sStatus: %s\n",
|
||||
prefix == NOSTR ? "" : prefix, statout);
|
||||
prefix == NULL ? "" : prefix, statout);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -286,7 +286,7 @@ sendmail(v)
|
||||
struct header head;
|
||||
|
||||
head.h_to = extract(str, GTO);
|
||||
head.h_subject = NOSTR;
|
||||
head.h_subject = NULL;
|
||||
head.h_cc = NIL;
|
||||
head.h_bcc = NIL;
|
||||
head.h_smopts = NIL;
|
||||
@ -315,18 +315,18 @@ mail1(hp, printheaders)
|
||||
*/
|
||||
if ((mtf = collect(hp, printheaders)) == NULL)
|
||||
return;
|
||||
if (value("interactive") != NOSTR)
|
||||
if (value("askcc") != NOSTR || value("askbcc") != NOSTR) {
|
||||
if (value("askcc") != NOSTR)
|
||||
if (value("interactive") != NULL)
|
||||
if (value("askcc") != NULL || value("askbcc") != NULL) {
|
||||
if (value("askcc") != NULL)
|
||||
grabh(hp, GCC);
|
||||
if (value("askbcc") != NOSTR)
|
||||
if (value("askbcc") != NULL)
|
||||
grabh(hp, GBCC);
|
||||
} else {
|
||||
puts("EOT");
|
||||
(void)fflush(stdout);
|
||||
}
|
||||
if (fsize(mtf) == 0)
|
||||
if (hp->h_subject == NOSTR)
|
||||
if (hp->h_subject == NULL)
|
||||
puts("No message, no subject; hope that's ok");
|
||||
else
|
||||
puts("Null message body; hope that's ok");
|
||||
@ -361,12 +361,12 @@ mail1(hp, printheaders)
|
||||
char **t;
|
||||
|
||||
fputs("Sendmail arguments:", stdout);
|
||||
for (t = namelist; *t != NOSTR; t++)
|
||||
for (t = namelist; *t != NULL; t++)
|
||||
printf(" \"%s\"", *t);
|
||||
putchar('\n');
|
||||
goto out;
|
||||
}
|
||||
if ((cp = value("record")) != NOSTR)
|
||||
if ((cp = value("record")) != NULL)
|
||||
(void)savemail(expand(cp), mtf);
|
||||
/*
|
||||
* Fork, set up the temporary mail file as standard
|
||||
@ -389,7 +389,7 @@ mail1(hp, printheaders)
|
||||
sigaddset(&nset, SIGTTIN);
|
||||
sigaddset(&nset, SIGTTOU);
|
||||
prepare_child(&nset, fileno(mtf), -1);
|
||||
if ((cp = value("sendmail")) != NOSTR)
|
||||
if ((cp = value("sendmail")) != NULL)
|
||||
cp = expand(cp);
|
||||
else
|
||||
cp = _PATH_SENDMAIL;
|
||||
@ -397,7 +397,7 @@ mail1(hp, printheaders)
|
||||
warn(cp);
|
||||
_exit(1);
|
||||
}
|
||||
if (value("verbose") != NOSTR)
|
||||
if (value("verbose") != NULL)
|
||||
(void)wait_child(pid);
|
||||
else
|
||||
free_child(pid);
|
||||
@ -494,7 +494,7 @@ puthead(hp, fo, w)
|
||||
gotcha = 0;
|
||||
if (hp->h_to != NIL && w & GTO)
|
||||
fmt("To:", hp->h_to, fo, w&GCOMMA), gotcha++;
|
||||
if (hp->h_subject != NOSTR && w & GSUBJECT)
|
||||
if (hp->h_subject != NULL && w & GSUBJECT)
|
||||
fprintf(fo, "Subject: %s\n", hp->h_subject), gotcha++;
|
||||
if (hp->h_cc != NIL && w & GCC)
|
||||
fmt("Cc:", hp->h_cc, fo, w&GCOMMA), gotcha++;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: strings.c,v 1.4 1997/07/13 23:54:02 millert Exp $ */
|
||||
/* $OpenBSD: strings.c,v 1.5 1997/07/14 00:24:30 millert Exp $ */
|
||||
/* $NetBSD: strings.c,v 1.5 1996/06/08 19:48:40 christos Exp $ */
|
||||
|
||||
/*
|
||||
@ -38,7 +38,7 @@
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)strings.c 8.1 (Berkeley) 6/6/93";
|
||||
#else
|
||||
static char rcsid[] = "$OpenBSD: strings.c,v 1.4 1997/07/13 23:54:02 millert Exp $";
|
||||
static char rcsid[] = "$OpenBSD: strings.c,v 1.5 1997/07/14 00:24:30 millert Exp $";
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
@ -75,7 +75,7 @@ salloc(size)
|
||||
s &= ~(sizeof(char *) - 1);
|
||||
index = 0;
|
||||
for (sp = &stringdope[0]; sp < &stringdope[NSPACE]; sp++) {
|
||||
if (sp->s_topFree == NOSTR && (STRINGSIZE << index) >= s)
|
||||
if (sp->s_topFree == NULL && (STRINGSIZE << index) >= s)
|
||||
break;
|
||||
if (sp->s_nleft >= s)
|
||||
break;
|
||||
@ -83,10 +83,10 @@ salloc(size)
|
||||
}
|
||||
if (sp >= &stringdope[NSPACE])
|
||||
panic("String too large");
|
||||
if (sp->s_topFree == NOSTR) {
|
||||
if (sp->s_topFree == NULL) {
|
||||
index = sp - &stringdope[0];
|
||||
sp->s_topFree = (char *)malloc(STRINGSIZE << index);
|
||||
if (sp->s_topFree == NOSTR) {
|
||||
if (sp->s_topFree == NULL) {
|
||||
fprintf(stderr, "No room for space %d\n", index);
|
||||
panic("Internal error");
|
||||
}
|
||||
@ -114,7 +114,7 @@ sreset()
|
||||
return;
|
||||
index = 0;
|
||||
for (sp = &stringdope[0]; sp < &stringdope[NSPACE]; sp++) {
|
||||
if (sp->s_topFree == NOSTR)
|
||||
if (sp->s_topFree == NULL)
|
||||
continue;
|
||||
sp->s_nextFree = sp->s_topFree;
|
||||
sp->s_nleft = STRINGSIZE << index;
|
||||
@ -132,5 +132,5 @@ spreserve()
|
||||
register struct strings *sp;
|
||||
|
||||
for (sp = &stringdope[0]; sp < &stringdope[NSPACE]; sp++)
|
||||
sp->s_topFree = NOSTR;
|
||||
sp->s_topFree = NULL;
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: temp.c,v 1.6 1997/07/13 21:21:17 millert Exp $ */
|
||||
/* $OpenBSD: temp.c,v 1.7 1997/07/14 00:24:31 millert Exp $ */
|
||||
/* $NetBSD: temp.c,v 1.5 1996/06/08 19:48:42 christos Exp $ */
|
||||
|
||||
/*
|
||||
@ -38,7 +38,7 @@
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)temp.c 8.1 (Berkeley) 6/6/93";
|
||||
#else
|
||||
static char rcsid[] = "$OpenBSD: temp.c,v 1.6 1997/07/13 21:21:17 millert Exp $";
|
||||
static char rcsid[] = "$OpenBSD: temp.c,v 1.7 1997/07/14 00:24:31 millert Exp $";
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
@ -85,18 +85,18 @@ tinit()
|
||||
* It's okay to call savestr in here because main will
|
||||
* do a spreserve() after us.
|
||||
*/
|
||||
if (myname != NOSTR) {
|
||||
if (myname != NULL) {
|
||||
if (getuserid(myname) < 0)
|
||||
errx(1, "\"%s\" is not a user of this system", myname);
|
||||
} else {
|
||||
if ((cp = username()) == NOSTR) {
|
||||
if ((cp = username()) == NULL) {
|
||||
myname = "nobody";
|
||||
if (rcvmode)
|
||||
exit(1);
|
||||
} else
|
||||
myname = savestr(cp);
|
||||
}
|
||||
if ((cp = getenv("HOME")) == NOSTR || strlen(getenv("HOME")) >= PATHSIZE)
|
||||
if ((cp = getenv("HOME")) == NULL || strlen(getenv("HOME")) >= PATHSIZE)
|
||||
cp = ".";
|
||||
homedir = savestr(cp);
|
||||
if (debug)
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: tty.c,v 1.4 1997/07/13 23:54:03 millert Exp $ */
|
||||
/* $OpenBSD: tty.c,v 1.5 1997/07/14 00:24:31 millert Exp $ */
|
||||
/* $NetBSD: tty.c,v 1.7 1997/07/09 05:25:46 mikel Exp $ */
|
||||
|
||||
/*
|
||||
@ -38,7 +38,7 @@
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)tty.c 8.2 (Berkeley) 4/20/95";
|
||||
#else
|
||||
static char rcsid[] = "$OpenBSD: tty.c,v 1.4 1997/07/13 23:54:03 millert Exp $";
|
||||
static char rcsid[] = "$OpenBSD: tty.c,v 1.5 1997/07/14 00:24:31 millert Exp $";
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
@ -52,12 +52,12 @@ static char rcsid[] = "$OpenBSD: tty.c,v 1.4 1997/07/13 23:54:03 millert Exp $";
|
||||
#include "extern.h"
|
||||
#include <sys/ioctl.h>
|
||||
|
||||
static cc_t c_erase; /* Current erase char */
|
||||
static cc_t c_kill; /* Current kill char */
|
||||
static jmp_buf rewrite; /* Place to go when continued */
|
||||
static jmp_buf intjmp; /* Place to go when interrupted */
|
||||
static cc_t c_erase; /* Current erase char */
|
||||
static cc_t c_kill; /* Current kill char */
|
||||
static sigjmp_buf rewrite; /* Place to go when continued */
|
||||
static sigjmp_buf intjmp; /* Place to go when interrupted */
|
||||
#ifndef TIOCSTI
|
||||
static int ttyset; /* We must now do erase/kill */
|
||||
static int ttyset; /* We must now do erase/kill */
|
||||
#endif
|
||||
|
||||
/*
|
||||
@ -81,7 +81,7 @@ grabh(hp, gflags)
|
||||
sig_t savettin;
|
||||
int errs;
|
||||
#ifdef __GNUC__
|
||||
/* Avoid longjmp clobbering */
|
||||
/* Avoid siglongjmp clobbering */
|
||||
#ifdef TIOCSTI
|
||||
(void)&extproc;
|
||||
#endif
|
||||
@ -117,7 +117,7 @@ grabh(hp, gflags)
|
||||
warn("TIOCEXT: off");
|
||||
}
|
||||
# endif /* TIOCEXT */
|
||||
if (setjmp(intjmp))
|
||||
if (sigsetjmp(intjmp, 1))
|
||||
goto out;
|
||||
saveint = signal(SIGINT, ttyint);
|
||||
#endif
|
||||
@ -131,7 +131,7 @@ grabh(hp, gflags)
|
||||
}
|
||||
if (gflags & GSUBJECT) {
|
||||
#ifndef TIOCSTI
|
||||
if (!ttyset && hp->h_subject != NOSTR)
|
||||
if (!ttyset && hp->h_subject != NULL)
|
||||
ttyset++, tcsetattr(fileno(stdin), TCSADRAIN, &ttybuf);
|
||||
#endif
|
||||
hp->h_subject = readtty("Subject: ", hp->h_subject);
|
||||
@ -190,26 +190,26 @@ readtty(pr, src)
|
||||
int c;
|
||||
char *cp, *cp2;
|
||||
#if __GNUC__
|
||||
/* Avoid longjmp clobbering */
|
||||
/* Avoid siglongjmp clobbering */
|
||||
(void)&c;
|
||||
(void)&cp2;
|
||||
#endif
|
||||
|
||||
fputs(pr, stdout);
|
||||
fflush(stdout);
|
||||
if (src != NOSTR && strlen(src) > BUFSIZ - 2) {
|
||||
if (src != NULL && strlen(src) > BUFSIZ - 2) {
|
||||
puts("too long to edit");
|
||||
return(src);
|
||||
}
|
||||
#ifndef TIOCSTI
|
||||
if (src != NOSTR)
|
||||
if (src != NULL)
|
||||
cp = copy(src, canonb);
|
||||
else
|
||||
cp = copy("", canonb);
|
||||
fputs(canonb, stdout);
|
||||
fflush(stdout);
|
||||
#else
|
||||
cp = src == NOSTR ? "" : src;
|
||||
cp = src == NULL ? "" : src;
|
||||
while ((c = *cp++) != '\0') {
|
||||
if ((c_erase != _POSIX_VDISABLE && c == c_erase) ||
|
||||
(c_kill != _POSIX_VDISABLE && c == c_kill)) {
|
||||
@ -226,7 +226,7 @@ readtty(pr, src)
|
||||
while (cp2 < canonb + BUFSIZ)
|
||||
*cp2++ = 0;
|
||||
cp2 = cp;
|
||||
if (setjmp(rewrite))
|
||||
if (sigsetjmp(rewrite, 1))
|
||||
goto redo;
|
||||
signal(SIGTSTP, ttystop);
|
||||
signal(SIGTTOU, ttystop);
|
||||
@ -244,16 +244,16 @@ readtty(pr, src)
|
||||
signal(SIGTTIN, SIG_DFL);
|
||||
if (c == EOF && ferror(stdin)) {
|
||||
redo:
|
||||
cp = strlen(canonb) > 0 ? canonb : NOSTR;
|
||||
cp = strlen(canonb) > 0 ? canonb : NULL;
|
||||
clearerr(stdin);
|
||||
return(readtty(pr, cp));
|
||||
}
|
||||
#ifndef TIOCSTI
|
||||
if (cp == NOSTR || *cp == '\0')
|
||||
if (cp == NULL || *cp == '\0')
|
||||
return(src);
|
||||
cp2 = cp;
|
||||
if (!ttyset)
|
||||
return(strlen(canonb) > 0 ? savestr(canonb) : NOSTR);
|
||||
return(strlen(canonb) > 0 ? savestr(canonb) : NULL);
|
||||
while (*cp != '\0') {
|
||||
c = *cp++;
|
||||
if (c_erase != _POSIX_VDISABLE && c == c_erase) {
|
||||
@ -281,7 +281,7 @@ redo:
|
||||
*cp2 = '\0';
|
||||
#endif
|
||||
if (equal("", canonb))
|
||||
return(NOSTR);
|
||||
return(NULL);
|
||||
return(savestr(canonb));
|
||||
}
|
||||
|
||||
@ -301,7 +301,7 @@ ttystop(s)
|
||||
kill(0, s);
|
||||
sigprocmask(SIG_UNBLOCK, &nset, NULL);
|
||||
signal(s, old_action);
|
||||
longjmp(rewrite, 1);
|
||||
siglongjmp(rewrite, 1);
|
||||
}
|
||||
|
||||
/*ARGSUSED*/
|
||||
@ -309,5 +309,5 @@ void
|
||||
ttyint(s)
|
||||
int s;
|
||||
{
|
||||
longjmp(intjmp, 1);
|
||||
siglongjmp(intjmp, 1);
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: v7.local.c,v 1.7 1997/07/13 21:21:18 millert Exp $ */
|
||||
/* $OpenBSD: v7.local.c,v 1.8 1997/07/14 00:24:31 millert Exp $ */
|
||||
/* $NetBSD: v7.local.c,v 1.8 1997/05/13 06:15:58 mikel Exp $ */
|
||||
|
||||
/*
|
||||
@ -38,7 +38,7 @@
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)v7.local.c 8.1 (Berkeley) 6/6/93";
|
||||
#else
|
||||
static char rcsid[] = "$OpenBSD: v7.local.c,v 1.7 1997/07/13 21:21:18 millert Exp $";
|
||||
static char rcsid[] = "$OpenBSD: v7.local.c,v 1.8 1997/07/14 00:24:31 millert Exp $";
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
@ -81,7 +81,7 @@ void
|
||||
demail()
|
||||
{
|
||||
|
||||
if (value("keep") != NOSTR || rm(mailname) < 0)
|
||||
if (value("keep") != NULL || rm(mailname) < 0)
|
||||
(void)close(creat(mailname, 0600));
|
||||
}
|
||||
|
||||
@ -94,12 +94,12 @@ username()
|
||||
char *np;
|
||||
uid_t uid;
|
||||
|
||||
if ((np = getenv("USER")) != NOSTR)
|
||||
if ((np = getenv("USER")) != NULL)
|
||||
return(np);
|
||||
if ((np = getenv("LOGNAME")) != NOSTR)
|
||||
if ((np = getenv("LOGNAME")) != NULL)
|
||||
return(np);
|
||||
if ((np = getname(uid = getuid())) != NOSTR)
|
||||
if ((np = getname(uid = getuid())) != NULL)
|
||||
return(np);
|
||||
printf("Cannot associate a name with uid %u\n", (unsigned)uid);
|
||||
return(NOSTR);
|
||||
return(NULL);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user