X-Git-Url: https://git.exim.org/exim.git/blobdiff_plain/059ec3d9952740285fb1ebf47961b8aca2eb1b4a..0a49a7a4f1090b6f1ce1d0f9d969804c9226b53e:/src/src/header.c diff --git a/src/src/header.c b/src/src/header.c index 2cac551c6..1b6bf56d1 100644 --- a/src/src/header.c +++ b/src/src/header.c @@ -1,10 +1,10 @@ -/* $Cambridge: exim/src/src/header.c,v 1.1 2004/10/07 10:39:01 ph10 Exp $ */ +/* $Cambridge: exim/src/src/header.c,v 1.8 2009/11/16 19:50:37 nm4 Exp $ */ /************************************************* * Exim - an Internet mail transport agent * *************************************************/ -/* Copyright (c) University of Cambridge 1995 - 2004 */ +/* Copyright (c) University of Cambridge 1995 - 2009 */ /* See the file NOTICE for conditions of use and distribution. */ @@ -40,6 +40,18 @@ while (*tt == ' ' || *tt == '\t') tt++; return *tt == ':'; } +/* This is a copy of the function above, only that it is possible to pass + only the beginning of a header name. It simply does a front-anchored + substring match. Arguments and Return codes are the same as for + header_testname() above. */ + +BOOL +header_testname_incomplete(header_line *h, uschar *name, int len, BOOL notdel) +{ +if (h->type == '*' && notdel) return FALSE; +if (h->text == NULL || strncmpic(h->text, name, len) != 0) return FALSE; +return TRUE; +} /************************************************* @@ -106,7 +118,14 @@ if (name == NULL) else { hptr = &header_list; - h = header_list; + + /* header_list->text can be NULL if we get here between when the new + received header is allocated and when it is acutally filled in. We want + that header to be first, so skip it for now. */ + + if (header_list->text == NULL) + hptr = &header_list->next; + h = *hptr; } }