dovecot: Use even easier way to check for first header: name_off...
dovecot at dovecot.org
dovecot at dovecot.org
Thu Nov 8 19:46:24 EET 2007
details: http://hg.dovecot.org/dovecot/rev/20829db7b96a
changeset: 6743:20829db7b96a
user: Timo Sirainen <tss at iki.fi>
date: Thu Nov 08 19:46:21 2007 +0200
description:
Use even easier way to check for first header: name_offset==0.
diffstat:
1 file changed, 6 insertions(+), 7 deletions(-)
src/deliver/deliver.c | 13 ++++++-------
diffs (30 lines):
diff -r 87a0f26edb39 -r 20829db7b96a src/deliver/deliver.c
--- a/src/deliver/deliver.c Thu Nov 08 19:44:52 2007 +0200
+++ b/src/deliver/deliver.c Thu Nov 08 19:46:21 2007 +0200
@@ -492,12 +492,11 @@ static const char *address_sanitize(cons
static void save_header_callback(struct message_header_line *hdr,
- bool *matched, struct istream *input)
-{
- if (input->v_offset == 0) {
- if (hdr != NULL && strncmp(hdr->name, "From ", 5) == 0)
- *matched = TRUE;
- }
+ bool *matched, void *context ATTR_UNUSED)
+{
+ if (hdr != NULL && hdr->name_offset == 0 &&
+ strncmp(hdr->name, "From ", 5) == 0)
+ *matched = TRUE;
}
static struct istream *
@@ -522,7 +521,7 @@ create_mbox_stream(int fd, const char *e
HEADER_FILTER_NO_CR,
mbox_hide_headers,
mbox_hide_headers_count,
- save_header_callback, input);
+ save_header_callback, NULL);
i_stream_unref(&input);
input_list[0] = i_stream_create_from_data(mbox_hdr, strlen(mbox_hdr));
More information about the dovecot-cvs
mailing list