Deleted Added
full compact
head.c (1591) head.c (74769)
1/*
2 * Copyright (c) 1980, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 18 unchanged lines hidden (view full) ---

27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 * SUCH DAMAGE.
32 */
33
34#ifndef lint
1/*
2 * Copyright (c) 1980, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 18 unchanged lines hidden (view full) ---

27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 * SUCH DAMAGE.
32 */
33
34#ifndef lint
35#if 0
35static char sccsid[] = "@(#)head.c 8.1 (Berkeley) 6/6/93";
36static char sccsid[] = "@(#)head.c 8.1 (Berkeley) 6/6/93";
37#endif
38static const char rcsid[] =
39 "$FreeBSD: head/usr.bin/mail/head.c 74769 2001-03-25 04:57:05Z mikeh $";
36#endif /* not lint */
37
38#include "rcv.h"
39#include "extern.h"
40
41/*
42 * Mail -- a mail program
43 *

--- 4 unchanged lines hidden (view full) ---

48 * See if the passed line buffer is a mail header.
49 * Return true if yes. Note the extreme pains to
50 * accomodate all funny formats.
51 */
52int
53ishead(linebuf)
54 char linebuf[];
55{
40#endif /* not lint */
41
42#include "rcv.h"
43#include "extern.h"
44
45/*
46 * Mail -- a mail program
47 *

--- 4 unchanged lines hidden (view full) ---

52 * See if the passed line buffer is a mail header.
53 * Return true if yes. Note the extreme pains to
54 * accomodate all funny formats.
55 */
56int
57ishead(linebuf)
58 char linebuf[];
59{
56 register char *cp;
57 struct headline hl;
58 char parbuf[BUFSIZ];
59
60 struct headline hl;
61 char parbuf[BUFSIZ];
62
60 cp = linebuf;
61 if (*cp++ != 'F' || *cp++ != 'r' || *cp++ != 'o' || *cp++ != 'm' ||
62 *cp++ != ' ')
63 if (strncmp(linebuf, "From ", 5))
63 return (0);
64 parse(linebuf, &hl, parbuf);
65 if (hl.l_from == NOSTR || hl.l_date == NOSTR) {
66 fail(linebuf, "No from or date field");
67 return (0);
68 }
69 if (!isdate(hl.l_date)) {
70 fail(linebuf, "Date field not legal date");

--- 184 unchanged lines hidden ---
64 return (0);
65 parse(linebuf, &hl, parbuf);
66 if (hl.l_from == NOSTR || hl.l_date == NOSTR) {
67 fail(linebuf, "No from or date field");
68 return (0);
69 }
70 if (!isdate(hl.l_date)) {
71 fail(linebuf, "Date field not legal date");

--- 184 unchanged lines hidden ---