(1) Last-minute sieve patch (updates to latest spec).
[exim.git] / src / src / match.c
index eb54f232a3ca48f14c1e6ccfb4d9ef55c67610ba..106cb6a356551bf87b9babf003b5c0817df59bef 100644 (file)
@@ -1,10 +1,10 @@
-/* $Cambridge: exim/src/src/match.c,v 1.2 2004/11/12 15:03:40 ph10 Exp $ */
+/* $Cambridge: exim/src/src/match.c,v 1.5 2005/02/17 11:58:26 ph10 Exp $ */
 
 /*************************************************
 *     Exim - an Internet mail transport agent    *
 *************************************************/
 
-/* Copyright (c) University of Cambridge 1995 - 2004 */
+/* Copyright (c) University of Cambridge 1995 - 2005 */
 /* See the file NOTICE for conditions of use and distribution. */
 
 /* Functions for matching strings */
@@ -630,9 +630,11 @@ while ((sss = string_nextinlist(&list, &sep, buffer, sizeof(buffer))) != NULL)
             store_pool = POOL_PERM;
             p = store_get(sizeof(namedlist_cacheblock));
             p->key = string_copy(get_check_key(arg, type));
+
+
+            p->data = (*valueptr == NULL)? NULL : string_copy(*valueptr);
             store_pool = old_pool;
 
-            p->data = *valueptr;
             p->next = nb->cache_data;
             nb->cache_data = p;
             if (*valueptr != NULL)
@@ -932,7 +934,7 @@ error = error;  /* Keep clever compilers from complaining */
 DEBUG(D_lists) debug_printf("address match: subject=%s pattern=%s\n",
   subject, pattern);
 
-/* Handle a regular expression, which must match the entire incoming address. 
+/* Handle a regular expression, which must match the entire incoming address.
 This may be the empty address. */
 
 if (*pattern == '^')
@@ -947,7 +949,7 @@ for (s = pattern; isalnum(*s) || *s == '-'; s++);
 if (*s == '*') s++;
 if (*s == '@') s++;
 
-/* If it is a straight lookup, do a lookup for the whole address. This may be 
+/* If it is a straight lookup, do a lookup for the whole address. This may be
 the empty address. Partial matching doesn't make sense here, so we ignore it,
 but write a panic log entry. However, *@ matching will be honoured. */
 
@@ -960,8 +962,8 @@ if (*s == ';')
     valueptr);
   }
 
-/* For the remaining cases, an empty subject matches only an empty pattern, 
-because other patterns expect to have a local part and a domain to match 
+/* For the remaining cases, an empty subject matches only an empty pattern,
+because other patterns expect to have a local part and a domain to match
 against. */
 
 if (*subject == 0) return (*pattern == 0)? OK : FAIL;