=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/mail/cmd3.c,v retrieving revision 1.6 retrieving revision 1.7 diff -c -r1.6 -r1.7 *** src/usr.bin/mail/cmd3.c 1997/07/13 23:53:58 1.6 --- src/usr.bin/mail/cmd3.c 1997/07/14 00:24:25 1.7 *************** *** 1,4 **** ! /* $OpenBSD: cmd3.c,v 1.6 1997/07/13 23:53:58 millert Exp $ */ /* $NetBSD: cmd3.c,v 1.8 1997/07/09 05:29:49 mikel Exp $ */ /* --- 1,4 ---- ! /* $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,44 **** #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 $"; #endif #endif /* not lint */ --- 38,44 ---- #if 0 static char sccsid[] = "@(#)cmd3.c 8.2 (Berkeley) 4/20/95"; #else ! static char rcsid[] = "$OpenBSD: cmd3.c,v 1.7 1997/07/14 00:24:25 millert Exp $"; #endif #endif /* not lint */ *************** *** 68,76 **** (void)strcpy(cmd, str); if (bangexp(cmd) < 0) return(1); ! if ((shell = value("SHELL")) == NOSTR) shell = _PATH_CSHELL; ! (void)run_command(shell, 0, -1, -1, "-c", cmd, NOSTR); (void)signal(SIGINT, sigint); puts("!"); return(0); --- 68,76 ---- (void)strcpy(cmd, str); if (bangexp(cmd) < 0) return(1); ! if ((shell = value("SHELL")) == NULL) shell = _PATH_CSHELL; ! (void)run_command(shell, 0, -1, -1, "-c", cmd, NULL); (void)signal(SIGINT, sigint); puts("!"); return(0); *************** *** 87,95 **** sig_t sigint = signal(SIGINT, SIG_IGN); char *shell; ! if ((shell = value("SHELL")) == NOSTR) shell = _PATH_CSHELL; ! (void)run_command(shell, 0, -1, -1, NOSTR, NOSTR, NOSTR); (void)signal(SIGINT, sigint); putchar('\n'); return(0); --- 87,95 ---- sig_t sigint = signal(SIGINT, SIG_IGN); char *shell; ! if ((shell = value("SHELL")) == NULL) shell = _PATH_CSHELL; ! (void)run_command(shell, 0, -1, -1, NULL, NULL, NULL); (void)signal(SIGINT, sigint); putchar('\n'); return(0); *************** *** 181,190 **** char **arglist = v; char *cp; ! if (*arglist == NOSTR) cp = homedir; else ! if ((cp = expand(*arglist)) == NOSTR) return(1); if (chdir(cp) < 0) { warn(cp); --- 181,190 ---- char **arglist = v; char *cp; ! if (*arglist == NULL) cp = homedir; else ! if ((cp = expand(*arglist)) == NULL) return(1); if (chdir(cp) < 0) { warn(cp); *************** *** 198,204 **** void *v; { int *msgvec = v; ! if (value("Replyall") == NOSTR) return(_respond(msgvec)); else return(_Respond(msgvec)); --- 198,204 ---- void *v; { int *msgvec = v; ! if (value("Replyall") == NULL) return(_respond(msgvec)); else return(_Respond(msgvec)); *************** *** 225,235 **** mp = &message[msgvec[0] - 1]; touch(mp); dot = mp; ! if ((rcv = skin(hfield("from", mp))) == NOSTR) rcv = skin(nameof(mp, 1)); ! if ((replyto = skin(hfield("reply-to", mp))) != NOSTR) np = extract(replyto, GTO); ! else if ((cp = skin(hfield("to", mp))) != NOSTR) np = extract(cp, GTO); else np = NIL; --- 225,235 ---- mp = &message[msgvec[0] - 1]; touch(mp); dot = mp; ! if ((rcv = skin(hfield("from", mp))) == NULL) rcv = skin(nameof(mp, 1)); ! if ((replyto = skin(hfield("reply-to", mp))) != NULL) np = extract(replyto, GTO); ! else if ((cp = skin(hfield("to", mp))) != NULL) np = extract(cp, GTO); else np = NIL; *************** *** 242,259 **** if (altnames) for (ap = altnames; *ap; ap++) np = delname(np, *ap); ! if (np != NIL && replyto == NOSTR) np = cat(np, extract(rcv, GTO)); else if (np == NIL) { ! if (replyto != NOSTR) puts("Empty reply-to field -- replying to author"); np = extract(rcv, GTO); } head.h_to = np; ! if ((head.h_subject = hfield("subject", mp)) == NOSTR) head.h_subject = hfield("subj", mp); head.h_subject = reedit(head.h_subject); ! if (replyto == NOSTR && (cp = skin(hfield("cc", mp))) != NOSTR) { np = elide(extract(cp, GCC)); np = delname(np, myname); if (altnames != 0) --- 242,259 ---- if (altnames) for (ap = altnames; *ap; ap++) np = delname(np, *ap); ! if (np != NIL && replyto == NULL) np = cat(np, extract(rcv, GTO)); else if (np == NIL) { ! 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)) == NULL) head.h_subject = hfield("subj", mp); head.h_subject = reedit(head.h_subject); ! if (replyto == NULL && (cp = skin(hfield("cc", mp))) != NULL) { np = elide(extract(cp, GCC)); np = delname(np, myname); if (altnames != 0) *************** *** 278,285 **** { char *newsubj; ! if (subj == NOSTR) ! return(NOSTR); if ((subj[0] == 'r' || subj[0] == 'R') && (subj[1] == 'e' || subj[1] == 'E') && subj[2] == ':') --- 278,285 ---- { char *newsubj; ! if (subj == NULL) ! return(NULL); if ((subj[0] == 'r' || subj[0] == 'R') && (subj[1] == 'e' || subj[1] == 'E') && subj[2] == ':') *************** *** 381,387 **** char varbuf[BUFSIZ], **ap, **p; int errs, h, s; ! if (*arglist == NOSTR) { for (h = 0, s = 1; h < HSHSIZE; h++) for (vp = variables[h]; vp != NOVAR; vp = vp->v_link) s++; --- 381,387 ---- char varbuf[BUFSIZ], **ap, **p; int errs, h, s; ! if (*arglist == NULL) { for (h = 0, s = 1; h < HSHSIZE; h++) for (vp = variables[h]; vp != NOVAR; vp = vp->v_link) s++; *************** *** 389,402 **** for (h = 0, p = ap; h < HSHSIZE; h++) for (vp = variables[h]; vp != NOVAR; vp = vp->v_link) *p++ = vp->v_name; ! *p = NOSTR; sort(ap); ! for (p = ap; *p != NOSTR; p++) printf("%s\t%s\n", *p, value(*p)); return(0); } errs = 0; ! for (ap = arglist; *ap != NOSTR; ap++) { cp = *ap; cp2 = varbuf; while (*cp != '=' && *cp != '\0') --- 389,402 ---- for (h = 0, p = ap; h < HSHSIZE; h++) for (vp = variables[h]; vp != NOVAR; vp = vp->v_link) *p++ = vp->v_name; ! *p = NULL; sort(ap); ! for (p = ap; *p != NULL; p++) printf("%s\t%s\n", *p, value(*p)); return(0); } errs = 0; ! for (ap = arglist; *ap != NULL; ap++) { cp = *ap; cp2 = varbuf; while (*cp != '=' && *cp != '\0') *************** *** 429,435 **** char **ap; errs = 0; ! for (ap = arglist; *ap != NOSTR; ap++) { if ((vp2 = lookup(*ap)) == NOVAR) { if (!sourcing) { printf("\"%s\": undefined variable\n", *ap); --- 429,435 ---- char **ap; errs = 0; ! for (ap = arglist; *ap != NULL; ap++) { if ((vp2 = lookup(*ap)) == NOVAR) { if (!sourcing) { printf("\"%s\": undefined variable\n", *ap); *************** *** 469,475 **** int s; char **ap, *gname, **p; ! if (*argv == NOSTR) { for (h = 0, s = 1; h < HSHSIZE; h++) for (gh = groups[h]; gh != NOGRP; gh = gh->g_link) s++; --- 469,475 ---- int s; char **ap, *gname, **p; ! if (*argv == NULL) { for (h = 0, s = 1; h < HSHSIZE; h++) for (gh = groups[h]; gh != NOGRP; gh = gh->g_link) s++; *************** *** 477,489 **** for (h = 0, p = ap; h < HSHSIZE; h++) for (gh = groups[h]; gh != NOGRP; gh = gh->g_link) *p++ = gh->g_name; ! *p = NOSTR; sort(ap); ! for (p = ap; *p != NOSTR; p++) printgroup(*p); return(0); } ! if (argv[1] == NOSTR) { printgroup(*argv); return(0); } --- 477,489 ---- for (h = 0, p = ap; h < HSHSIZE; h++) for (gh = groups[h]; gh != NOGRP; gh = gh->g_link) *p++ = gh->g_name; ! *p = NULL; sort(ap); ! for (p = ap; *p != NULL; p++) printgroup(*p); return(0); } ! if (argv[1] == NULL) { printgroup(*argv); return(0); } *************** *** 503,509 **** * later anyway. */ ! for (ap = argv+1; *ap != NOSTR; ap++) { gp = (struct group *)calloc(sizeof(*gp), 1); gp->ge_name = vcopy(*ap); gp->ge_link = gh->g_list; --- 503,509 ---- * later anyway. */ ! 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,528 **** { register char **ap; ! for (ap = list; *ap != NOSTR; ap++) ; if (ap-list < 2) return; --- 522,528 ---- { register char **ap; ! for (ap = list; *ap != NULL; ap++) ; if (ap-list < 2) return; *************** *** 562,568 **** { char **argv = v; ! if (argv[0] == NOSTR) { newfileinfo(0); return(0); } --- 562,568 ---- { char **argv = v; ! if (argv[0] == NULL) { newfileinfo(0); return(0); } *************** *** 583,591 **** register char **ap; register char *cp; ! for (ap = argv; *ap != NOSTR; ap++) { cp = *ap; ! if ((cp = expand(cp)) != NOSTR) { if (ap != argv) putchar(' '); fputs(cp, stdout); --- 583,591 ---- register char **ap; register char *cp; ! for (ap = argv; *ap != NULL; ap++) { cp = *ap; ! if ((cp = expand(cp)) != NULL) { if (ap != argv) putchar(' '); fputs(cp, stdout); *************** *** 600,606 **** void *v; { int *msgvec = v; ! if (value("Replyall") == NOSTR) return(_Respond(msgvec)); else return(_respond(msgvec)); --- 600,606 ---- void *v; { int *msgvec = v; ! if (value("Replyall") == NULL) return(_Respond(msgvec)); else return(_respond(msgvec)); *************** *** 625,638 **** mp = &message[*ap - 1]; touch(mp); dot = mp; ! if ((cp = skin(hfield("from", mp))) == NOSTR) 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) head.h_subject = hfield("subj", mp); head.h_subject = reedit(head.h_subject); head.h_cc = NIL; --- 625,638 ---- mp = &message[*ap - 1]; touch(mp); dot = mp; ! 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)) == NULL) head.h_subject = hfield("subj", mp); head.h_subject = reedit(head.h_subject); head.h_cc = NIL;