=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/mail/Attic/aux.c,v retrieving revision 1.6 retrieving revision 1.7 diff -c -r1.6 -r1.7 *** src/usr.bin/mail/Attic/aux.c 1997/07/13 23:53:56 1.6 --- src/usr.bin/mail/Attic/aux.c 1997/07/14 00:24:24 1.7 *************** *** 1,4 **** ! /* $OpenBSD: aux.c,v 1.6 1997/07/13 23:53:56 millert Exp $ */ /* $NetBSD: aux.c,v 1.5 1997/05/13 06:15:52 mikel Exp $ */ /* --- 1,4 ---- ! /* $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,44 **** #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 $"; #endif #endif /* not lint */ --- 38,44 ---- #if 0 static char sccsid[] = "@(#)aux.c 8.1 (Berkeley) 6/6/93"; #else ! static char rcsid[] = "$OpenBSD: aux.c,v 1.7 1997/07/14 00:24:24 millert Exp $"; #endif #endif /* not lint */ *************** *** 62,68 **** char *new; int size = strlen(str) + 1; ! if ((new = salloc(size)) != NOSTR) (void)memcpy(new, str, size); return(new); } --- 62,68 ---- char *new; int size = strlen(str) + 1; ! if ((new = salloc(size)) != NULL) (void)memcpy(new, str, size); return(new); } *************** *** 78,84 **** int newsize = strlen(str) + 1; int oldsize = old ? strlen(old) + 1 : 0; ! if ((new = salloc(newsize + oldsize)) != NOSTR) { if (oldsize) { (void)memcpy(new, old, oldsize); new[oldsize - 1] = ' '; --- 78,84 ---- int newsize = strlen(str) + 1; int oldsize = old ? strlen(old) + 1 : 0; ! if ((new = salloc(newsize + oldsize)) != NULL) { if (oldsize) { (void)memcpy(new, old, oldsize); new[oldsize - 1] = ' '; *************** *** 159,172 **** { register char **ap; ! for (ap = argv; *ap++ != NOSTR;) ; return(ap - argv - 1); } /* * Return the desired header line from the passed message ! * pointer (or NOSTR if the desired header field is not available). */ char * hfield(field, mp) --- 159,172 ---- { register char **ap; ! for (ap = argv; *ap++ != NULL;) ; return(ap - argv - 1); } /* * Return the desired header line from the passed message ! * pointer (or NULL if the desired header field is not available). */ char * hfield(field, mp) *************** *** 177,189 **** char linebuf[LINESIZE]; register int lc; register char *hfield; ! char *colon, *oldhfield = NOSTR; ibuf = setinput(mp); if ((lc = mp->m_lines - 1) < 0) ! return(NOSTR); if (readline(ibuf, linebuf, LINESIZE) < 0) ! return(NOSTR); while (lc > 0) { if ((lc = gethfield(ibuf, linebuf, lc, &colon)) < 0) return(oldhfield); --- 177,189 ---- char linebuf[LINESIZE]; register int lc; register char *hfield; ! char *colon, *oldhfield = NULL; ibuf = setinput(mp); if ((lc = mp->m_lines - 1) < 0) ! return(NULL); if (readline(ibuf, linebuf, LINESIZE) < 0) ! return(NULL); while (lc > 0) { if ((lc = gethfield(ibuf, linebuf, lc, &colon)) < 0) return(oldhfield); *************** *** 318,324 **** FILE *fi; char *cp; ! if ((cp = expand(*arglist)) == NOSTR) return(1); if ((fi = Fopen(cp, "r")) == NULL) { warn(cp); --- 318,324 ---- FILE *fi; char *cp; ! if ((cp = expand(*arglist)) == NULL) return(1); if ((fi = Fopen(cp, "r")) == NULL) { warn(cp); *************** *** 464,473 **** int gotlt, lastsp; char nbuf[BUFSIZ]; ! if (name == NOSTR) ! return(NOSTR); ! if (strchr(name, '(') == NOSTR && strchr(name, '<') == NOSTR ! && strchr(name, ' ') == NOSTR) return(name); gotlt = 0; lastsp = 0; --- 464,473 ---- int gotlt, lastsp; char nbuf[BUFSIZ]; ! if (name == NULL) ! return(NULL); ! if (strchr(name, '(') == NULL && strchr(name, '<') == NULL ! && strchr(name, ' ') == NULL) return(name); gotlt = 0; lastsp = 0; *************** *** 573,581 **** register FILE *ibuf; int first = 1; ! if ((cp = hfield("from", mp)) != NOSTR) return(cp); ! if (reptype == 0 && (cp = hfield("sender", mp)) != NOSTR) return(cp); ibuf = setinput(mp); namebuf[0] = '\0'; --- 573,581 ---- register FILE *ibuf; int first = 1; ! if ((cp = hfield("from", mp)) != NULL) return(cp); ! if (reptype == 0 && (cp = hfield("sender", mp)) != NULL) return(cp); ibuf = setinput(mp); namebuf[0] = '\0';