prepend (not append) Resent-Message-ID and Resent-Date. fixes: #508
[exim.git] / src / src / header.c
index 550b9c8017ce4901a4c969ba0046b8076f0478ba..dea5fbe654b83b053bbf1a53d6c5f65bac469b89 100644 (file)
@@ -1,10 +1,10 @@
-/* $Cambridge: exim/src/src/header.c,v 1.4 2005/01/04 10:00:42 ph10 Exp $ */
+/* $Cambridge: exim/src/src/header.c,v 1.7 2009/10/16 12:33:09 nm4 Exp $ */
 
 /*************************************************
 *     Exim - an Internet mail transport agent    *
 *************************************************/
 
-/* Copyright (c) University of Cambridge 1995 - 2005 */
+/* Copyright (c) University of Cambridge 1995 - 2007 */
 /* See the file NOTICE for conditions of use and distribution. */
 
 
@@ -118,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;
     }
   }