=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/mail/Attic/aux.c,v retrieving revision 1.4 retrieving revision 1.5 diff -c -r1.4 -r1.5 *** src/usr.bin/mail/Attic/aux.c 1997/05/30 08:51:32 1.4 --- src/usr.bin/mail/Attic/aux.c 1997/07/13 21:21:08 1.5 *************** *** 1,5 **** ! /* $OpenBSD: aux.c,v 1.4 1997/05/30 08:51:32 deraadt Exp $ */ ! /* $NetBSD: aux.c,v 1.4 1996/06/08 19:48:10 christos Exp $ */ /* * Copyright (c) 1980, 1993 --- 1,5 ---- ! /* $OpenBSD: aux.c,v 1.5 1997/07/13 21:21:08 millert Exp $ */ ! /* $NetBSD: aux.c,v 1.5 1997/05/13 06:15:52 mikel Exp $ */ /* * Copyright (c) 1980, 1993 *************** *** 38,44 **** #if 0 static char sccsid[] = "@(#)aux.c 8.1 (Berkeley) 6/6/93"; #else ! static char rcsid[] = "$OpenBSD: aux.c,v 1.4 1997/05/30 08:51:32 deraadt 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.5 1997/07/13 21:21:08 millert Exp $"; #endif #endif /* not lint */ *************** *** 64,70 **** if ((new = salloc(size)) != NOSTR) bcopy(str, new, size); ! return new; } /* --- 64,70 ---- if ((new = salloc(size)) != NOSTR) bcopy(str, new, size); ! return(new); } /* *************** *** 85,91 **** } bcopy(str, new + oldsize, newsize); } ! return new; } /* --- 85,91 ---- } bcopy(str, new + oldsize, newsize); } ! return(new); } /* *************** *** 115,121 **** (void)fprintf(stderr, "panic: "); vfprintf(stderr, fmt, ap); va_end(ap); ! (void)fprintf(stderr, "\n"); fflush(stderr); abort(); } --- 115,121 ---- (void)fprintf(stderr, "panic: "); vfprintf(stderr, fmt, ap); va_end(ap); ! (void)putc('\n', stderr); fflush(stderr); abort(); } *************** *** 161,167 **** for (ap = argv; *ap++ != NOSTR;) ; ! return ap - argv - 1; } /* --- 161,167 ---- for (ap = argv; *ap++ != NOSTR;) ; ! return(ap - argv - 1); } /* *************** *** 181,196 **** 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; if ((hfield = ishfield(linebuf, colon, field)) != NULL) oldhfield = save2str(hfield, oldhfield); } ! return oldhfield; } /* --- 181,196 ---- 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); if ((hfield = ishfield(linebuf, colon, field)) != NULL) oldhfield = save2str(hfield, oldhfield); } ! return(oldhfield); } /* *************** *** 212,220 **** for (;;) { if (--rem < 0) ! return -1; if ((c = readline(f, linebuf, LINESIZE)) <= 0) ! return -1; for (cp = linebuf; isprint(*cp) && *cp != ' ' && *cp != ':'; cp++) ; --- 212,220 ---- for (;;) { if (--rem < 0) ! return(-1); if ((c = readline(f, linebuf, LINESIZE)) <= 0) ! return(-1); for (cp = linebuf; isprint(*cp) && *cp != ' ' && *cp != ':'; cp++) ; *************** *** 248,254 **** cp += c; } *cp = 0; ! return rem; } /* NOTREACHED */ } --- 248,254 ---- cp += c; } *cp = 0; ! return(rem); } /* NOTREACHED */ } *************** *** 268,279 **** *cp = 0; if (strcasecmp(linebuf, field) != 0) { *cp = ':'; ! return 0; } *cp = ':'; for (cp++; *cp == ' ' || *cp == '\t'; cp++) ; ! return cp; } /* --- 268,279 ---- *cp = 0; if (strcasecmp(linebuf, field) != 0) { *cp = ':'; ! return(0); } *cp = ':'; for (cp++; *cp == ' ' || *cp == '\t'; cp++) ; ! return(cp); } /* *************** *** 321,332 **** if ((cp = expand(*arglist)) == NOSTR) return(1); if ((fi = Fopen(cp, "r")) == NULL) { ! perror(cp); return(1); } if (ssp >= NOFILE - 1) { ! printf("Too much \"sourcing\" going on.\n"); ! Fclose(fi); return(1); } sstack[ssp].s_file = input; --- 321,332 ---- if ((cp = expand(*arglist)) == NOSTR) return(1); if ((fi = Fopen(cp, "r")) == NULL) { ! warn(cp); return(1); } if (ssp >= NOFILE - 1) { ! puts("Too much \"sourcing\" going on."); ! (void)Fclose(fi); return(1); } sstack[ssp].s_file = input; *************** *** 348,360 **** unstack() { if (ssp <= 0) { ! printf("\"Source\" stack over-pop.\n"); sourcing = 0; return(1); } ! Fclose(input); if (cond != CANY) ! printf("Unmatched \"if\"\n"); ssp--; cond = sstack[ssp].s_cond; loading = sstack[ssp].s_loading; --- 348,360 ---- unstack() { if (ssp <= 0) { ! puts("\"Source\" stack over-pop."); sourcing = 0; return(1); } ! (void)Fclose(input); if (cond != CANY) ! puts("Unmatched \"if\""); ssp--; cond = sstack[ssp].s_cond; loading = sstack[ssp].s_loading; *************** *** 447,453 **** break; } } ! return cp; } /* --- 447,453 ---- break; } } ! return(cp); } /* *************** *** 574,582 **** 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'; if (readline(ibuf, linebuf, LINESIZE) < 0) --- 574,582 ---- 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'; if (readline(ibuf, linebuf, LINESIZE) < 0) *************** *** 606,615 **** break; cp++; if (first) { ! strcpy(namebuf, cp); first = 0; } else ! strcpy(strrchr(namebuf, '!')+1, cp); strcat(namebuf, "!"); goto newname; } --- 606,617 ---- break; cp++; if (first) { ! cp2 = namebuf; first = 0; } else ! cp2 = strrchr(namebuf, '!') + 1; ! strncpy(cp2, cp, sizeof(namebuf) - (cp2 - namebuf) - 2); ! namebuf[sizeof(namebuf) - 2] = '\0'; strcat(namebuf, "!"); goto newname; } *************** *** 645,652 **** while (*s1) if (strchr(s2, *s1++)) ! return 1; ! return 0; } /* --- 647,654 ---- while (*s1) if (strchr(s2, *s1++)) ! return(1); ! return(0); } /* *************** *** 658,665 **** { if (islower(c)) ! return toupper(c); ! return c; } /* --- 660,667 ---- { if (islower(c)) ! return(toupper(c)); ! return(c); } /* *************** *** 672,678 **** while ((*s2++ = *s1++) != '\0') ; ! return s2 - 1; } /* --- 674,680 ---- while ((*s2++ = *s1++) != '\0') ; ! return(s2 - 1); } /* *************** *** 683,701 **** char *field; struct ignoretab ignore[2]; { ! char realfld[BUFSIZ]; if (ignore == ignoreall) ! return 1; /* * Lower-case the string, so that "Status" and "status" * will hash to the same place. */ istrcpy(realfld, field); if (ignore[1].i_count > 0) ! return (!member(realfld, ignore + 1)); else ! return (member(realfld, ignore)); } int --- 685,703 ---- char *field; struct ignoretab ignore[2]; { ! char realfld[LINESIZE]; if (ignore == ignoreall) ! return(1); /* * Lower-case the string, so that "Status" and "status" * will hash to the same place. */ istrcpy(realfld, field); if (ignore[1].i_count > 0) ! return(!member(realfld, ignore + 1)); else ! return(member(realfld, ignore)); } int *************** *** 708,713 **** for (igp = table->i_head[hash(realfield)]; igp != 0; igp = igp->i_link) if (*igp->i_field == *realfield && equal(igp->i_field, realfield)) ! return (1); ! return (0); } --- 710,715 ---- for (igp = table->i_head[hash(realfield)]; igp != 0; igp = igp->i_link) if (*igp->i_field == *realfield && equal(igp->i_field, realfield)) ! return(1); ! return(0); }