Merge branch 'tom_dev'
[exim.git] / src / src / filtertest.c
index c0a183d6aefbfbc85656da1ef680f8e941e75718..6eb92b2ea7091a1203fd1801c016a68df8884331 100644 (file)
@@ -1,10 +1,10 @@
-/* $Cambridge: exim/src/src/filtertest.c,v 1.4 2005/02/17 11:58:26 ph10 Exp $ */
+/* $Cambridge: exim/src/src/filtertest.c,v 1.12 2009/11/16 19:50:37 nm4 Exp $ */
 
 /*************************************************
 *     Exim - an Internet mail transport agent    *
 *************************************************/
 
-/* Copyright (c) University of Cambridge 1995 - 2005 */
+/* Copyright (c) University of Cambridge 1995 - 2009 */
 /* See the file NOTICE for conditions of use and distribution. */
 
 
 we can set up the message_body variables at the same time (in normal use, the
 message_body variables are not set up unless needed). The reading code is
 written out here rather than having options in read_message_data, in order to
-keep that function as efficient as possible. Handling message_body_end is
-somewhat more tedious. Pile it all into a circular buffer and sort out at the
-end.
+keep that function as efficient as possible. (Later: this function is now
+global because it is also used by the -bem testing option.) Handling
+message_body_end is somewhat more tedious. Pile it all into a circular buffer
+and sort out at the end.
 
 Arguments:
   dot_ended   TRUE if message already terminated by '.'
@@ -32,8 +33,8 @@ Arguments:
 Returns:      nothing
 */
 
-static void
-read_message_body(dot_ended)
+void
+read_message_body(BOOL dot_ended)
 {
 register int ch;
 int body_len, body_end_len, header_size;
@@ -181,7 +182,7 @@ if (fstat(fd, &statbuf) != 0)
 
 filebuf = store_get(statbuf.st_size + 1);
 rc = read(fd, filebuf, statbuf.st_size);
-close(fd);
+(void)close(fd);
 
 if (rc != statbuf.st_size)
   {
@@ -271,7 +272,7 @@ if (is_system)
 else
   {
   yield = (filter_type == FILTER_SIEVE)?
-    sieve_interpret(filebuf, RDO_REWRITE, NULL, &generated, &error)
+    sieve_interpret(filebuf, RDO_REWRITE, NULL, NULL, NULL, NULL, &generated, &error)
     :
     filter_interpret(filebuf, RDO_REWRITE, &generated, &error);
   }