Update version number and copyright year.
[exim.git] / src / src / exim.c
index 622b1ed01e4581d9d5d2526c0cbb2d1b03230cdf..5ed6e54e18ab27ca9bfa1db10b4c49c719101dff 100644 (file)
@@ -1,10 +1,10 @@
-/* $Cambridge: exim/src/src/exim.c,v 1.47 2006/11/07 10:28:09 ph10 Exp $ */
+/* $Cambridge: exim/src/src/exim.c,v 1.51 2007/01/08 10:50:18 ph10 Exp $ */
 
 /*************************************************
 *     Exim - an Internet mail transport agent    *
 *************************************************/
 
-/* Copyright (c) University of Cambridge 1995 - 2006 */
+/* Copyright (c) University of Cambridge 1995 - 2007 */
 /* See the file NOTICE for conditions of use and distribution. */
 
 
@@ -1498,7 +1498,8 @@ regex_ismsgid =
   regex_must_compile(US"^(?:[^\\W_]{6}-){2}[^\\W_]{2}$", FALSE, TRUE);
 
 /* Precompile the regular expression that is used for matching an SMTP error
-code, possibly extended, at the start of an error message. */
+code, possibly extended, at the start of an error message. Note that the
+terminating whitespace character is included. */
 
 regex_smtp_code =
   regex_must_compile(US"^\\d\\d\\d\\s(?:\\d\\.\\d\\d?\\d?\\.\\d\\d?\\d?\\s)?",
@@ -2646,6 +2647,11 @@ for (i = 1; i < argc; i++)
 
     case 'q':
     receiving_message = FALSE;
+    if (queue_interval >= 0)
+      {
+      fprintf(stderr, "exim: -q specified more than once\n");
+      exit(EXIT_FAILURE);
+      }
 
     /* -qq...: Do queue runs in a 2-stage manner */
 
@@ -2754,7 +2760,6 @@ for (i = 1; i < argc; i++)
         }
       }
     else deliver_selectstring = argrest;
-    if (queue_interval < 0) queue_interval = 0;
     break;
 
 
@@ -2802,7 +2807,6 @@ for (i = 1; i < argc; i++)
         }
       }
     else deliver_selectstring_sender = argrest;
-    if (queue_interval < 0) queue_interval = 0;
     break;
 
     /* -Tqt is an option that is exclusively for use by the testing suite.
@@ -2893,6 +2897,12 @@ for (i = 1; i < argc; i++)
   }
 
 
+/* If -R or -S have been specified without -q, assume a single queue run. */
+
+if ((deliver_selectstring != NULL || deliver_selectstring_sender != NULL) &&
+  queue_interval < 0) queue_interval = 0;
+
+
 /* Arguments have been processed. Check for incompatibilities. */
 
 END_ARG:
@@ -4238,6 +4248,7 @@ if (expansion_test)
     message_linecount += body_linecount;
     (void)dup2(save_stdin, 0);
     (void)close(save_stdin);
+    clearerr(stdin);               /* Required by Darwin */
     }
 
   /* Allow $recipients for this testing */