… | |
… | |
55 | #include <uudeview.h> |
55 | #include <uudeview.h> |
56 | #include <uuint.h> |
56 | #include <uuint.h> |
57 | #include <fptools.h> |
57 | #include <fptools.h> |
58 | #include <uustring.h> |
58 | #include <uustring.h> |
59 | |
59 | |
60 | char * uuscan_id = "$Id: uuscan.c,v 1.24 2020/12/11 20:27:00 root Exp $"; |
60 | char * uuscan_id = "$Id: uuscan.c,v 1.25 2020/12/13 02:55:12 root Exp $"; |
61 | |
61 | |
62 | /* |
62 | /* |
63 | * Header fields we recognize as such. See RFC822. We add "From ", |
63 | * Header fields we recognize as such. See RFC822. We add "From ", |
64 | * the usual marker for a beginning of a new message, and a couple |
64 | * the usual marker for a beginning of a new message, and a couple |
65 | * of usual MDA, News and MIME headers. |
65 | * of usual MDA, News and MIME headers. |
66 | * We make a distinction of MIME headers as we need the difference |
66 | * We make a distinction of MIME headers as we need the difference |
67 | * to scan the bodies from partial multipart messages. |
67 | * to scan the bodies from partial multipart messages. |
68 | */ |
68 | */ |
69 | |
69 | |
70 | #define LSTR(s) { sizeof (s) - 1, s } |
70 | #define LSTR(s) { (s), sizeof (s) - 1 } |
71 | |
71 | |
72 | struct lstr { |
72 | struct lstr { |
|
|
73 | const char *str; |
73 | int len; |
74 | int len; |
74 | const char *str; |
|
|
75 | }; |
75 | }; |
76 | |
76 | |
77 | #define MAX_KNOWNHEADERLEN 28 /* max. length of a known header */ |
77 | #define MAX_KNOWNHEADERLEN 28 /* max. length of a known header */ |
78 | |
78 | |
79 | static struct lstr knownheaders[] = { |
79 | static const struct lstr knownheaders[] = { |
80 | /* "From " handled in IsKnownHeader */ |
80 | /* "From " handled in IsKnownHeader */ |
81 | |
81 | |
82 | /* knownmsgheaders */ |
82 | /* knownmsgheaders */ |
83 | LSTR ("Return-Path"), LSTR ("Received"), LSTR ("Reply-To"), |
83 | LSTR ("Return-Path"), LSTR ("Received"), LSTR ("Reply-To"), |
84 | LSTR ("From"), LSTR ("Sender"), LSTR ("Resent-Reply-To"), LSTR ("Resent-From"), |
84 | LSTR ("From"), LSTR ("Sender"), LSTR ("Resent-Reply-To"), LSTR ("Resent-From"), |