Avoid clearing first_delivery flag on the initial half of a 2-phase queue run
[exim.git] / src / src / expand.c
index 37276dd693ab41f1f3b371377617e467dbf80818..8a571b2d905c6ed4bdf6a35c4a8ef6b8aa2a9a4b 100644 (file)
@@ -7324,10 +7324,10 @@ while (*s)
 
       case EOP_LISTCOUNT:
         {
-       int cnt = 0;
-       int sep = 0;
+       int cnt = 0, sep = 0;
+       uschar * buf = store_get(2, is_tainted(sub));
 
-       while (string_nextinlist(CUSS &sub, &sep, NULL, 0)) cnt++;
+       while (string_nextinlist(CUSS &sub, &sep, buf, 1)) cnt++;
        yield = string_fmt_append(yield, "%d", cnt);
         continue;
         }
@@ -8641,6 +8641,7 @@ debug_selector = D_v;
 debug_file = stderr;
 debug_fd = fileno(debug_file);
 big_buffer = malloc(big_buffer_size);
+store_init();
 
 for (int i = 1; i < argc; i++)
   {