[exim-cvs] tidying

Top Page
Delete this message
Reply to this message
Author: Exim Git Commits Mailing List
Date:  
To: exim-cvs
Subject: [exim-cvs] tidying
Gitweb: https://git.exim.org/exim.git/commitdiff/aa3c7e485be428d9d436f917793c8598bfebd3a1
Commit:     aa3c7e485be428d9d436f917793c8598bfebd3a1
Parent:     bff2d6435aecaf2701ba12c4dd99c7f395953f19
Author:     Jeremy Harris <jgh146exb@???>
AuthorDate: Mon Jun 3 13:55:04 2019 +0100
Committer:  Jeremy Harris <jgh146exb@???>
CommitDate: Wed Jun 26 11:08:20 2019 +0100


    tidying
---
 doc/doc-docbook/spec.xfpt |  4 ++--
 src/src/expand.c          | 26 +++++++++-----------------
 src/src/ip.c              |  2 +-
 src/src/rewrite.c         | 35 ++++++++++-------------------------
 test/runtest              |  3 +++
 5 files changed, 25 insertions(+), 45 deletions(-)


diff --git a/doc/doc-docbook/spec.xfpt b/doc/doc-docbook/spec.xfpt
index 34c4310..e11881c 100644
--- a/doc/doc-docbook/spec.xfpt
+++ b/doc/doc-docbook/spec.xfpt
@@ -23696,7 +23696,7 @@ inserted in the argument list at that point &'as a separate argument'&. This
avoids any problems with spaces or shell metacharacters, and is of use when a
&(pipe)& transport is handling groups of addresses in a batch.

-If &%force_command%& is enabled on the transport, Special handling takes place
+If &%force_command%& is enabled on the transport, special handling takes place
for an argument that consists of precisely the text &`$address_pipe`&. It
is handled similarly to &$pipe_addresses$& above. It is expanded and each
argument is inserted in the argument list at that point
@@ -30902,7 +30902,7 @@ client host, and its contents have been verified. If there has been no previous
attempt to verify the HELO/EHLO contents, it is carried out when this
condition is encountered. See the description of the &%helo_verify_hosts%& and
&%helo_try_verify_hosts%& options for details of how to request verification
-independently of this condition.
+independently of this condition, and for detail of the verification.

 For SMTP input that does not come over TCP/IP (the &%-bs%& command line
 option), this condition is always true.
diff --git a/src/src/expand.c b/src/src/expand.c
index 31059c4..2ddd22a 100644
--- a/src/src/expand.c
+++ b/src/src/expand.c
@@ -3709,17 +3709,15 @@ eval_expr(uschar **sptr, BOOL decimal, uschar **error, BOOL endket)
 {
 uschar *s = *sptr;
 int_eximarith_t x = eval_op_or(&s, decimal, error);
-if (*error == NULL)
-  {
+
+if (!*error)
   if (endket)
-    {
     if (*s != ')')
       *error = US"expecting closing parenthesis";
     else
       while (isspace(*(++s)));
-    }
-  else if (*s != 0) *error = US"expecting operator";
-  }
+  else if (*s)
+    *error = US"expecting operator";
 *sptr = s;
 return x;
 }
@@ -3728,12 +3726,12 @@ return x;
 static int_eximarith_t
 eval_number(uschar **sptr, BOOL decimal, uschar **error)
 {
-register int c;
+int c;
 int_eximarith_t n;
 uschar *s = *sptr;
+
 while (isspace(*s)) s++;
-c = *s;
-if (isdigit(c))
+if (isdigit((c = *s)))
   {
   int count;
   (void)sscanf(CS s, (decimal? SC_EXIM_DEC "%n" : SC_EXIM_ARITH "%n"), &n, &count);
@@ -3776,9 +3774,8 @@ if (*s == '+' || *s == '-' || *s == '~')
     else if (op == '~') x = ~x;
   }
 else
-  {
   x = eval_number(&s, decimal, error);
-  }
+
 *sptr = s;
 return x;
 }
@@ -6803,15 +6800,10 @@ while (*s != 0)
       case EOP_SHA256:
 #ifdef EXIM_HAVE_SHA2
     if (vp && *(void **)vp->value)
-      {
       if (c == EOP_SHA256)
-        {
-        uschar * cp = tls_cert_fprt_sha256(*(void **)vp->value);
-        yield = string_cat(yield, cp);
-        }
+        yield = string_cat(yield, tls_cert_fprt_sha256(*(void **)vp->value));
       else
         expand_string_message = US"sha2_N not supported with certificates";
-      }
     else
       {
       hctx h;
diff --git a/src/src/ip.c b/src/src/ip.c
index bf13d82..bc53db1 100644
--- a/src/src/ip.c
+++ b/src/src/ip.c
@@ -316,7 +316,7 @@ if (fastopen_blob && f.tcp_fastopen_ok)
     }
   else if (errno == EINPROGRESS)
     {
-    DEBUG(D_transport|D_v) debug_printf("TFO mode sendto, %s data: EINPROGRESS\n",
+    DEBUG(D_transport|D_v) debug_printf("TFO mode connectx, %s data: EINPROGRESS\n",
       fastopen_blob->len > 0 ? "with"  : "no");
     if (!fastopen_blob->data)
       {
diff --git a/src/src/rewrite.c b/src/src/rewrite.c
index 6b194ca..221b438 100644
--- a/src/src/rewrite.c
+++ b/src/src/rewrite.c
@@ -721,34 +721,19 @@ rewrite_header(header_line *h,
   const uschar *routed_old, const uschar *routed_new,
   rewrite_rule *rewrite_rules, int existflags, BOOL replace)
 {
+int flag;
 switch (h->type)
   {
-  case htype_sender:
-  return rewrite_one_header(h, rewrite_sender, routed_old, routed_new,
-    rewrite_rules, existflags, replace);
-
-  case htype_from:
-  return rewrite_one_header(h, rewrite_from, routed_old, routed_new,
-    rewrite_rules, existflags, replace);
-
-  case htype_to:
-  return rewrite_one_header(h, rewrite_to, routed_old, routed_new,
-    rewrite_rules, existflags, replace);
-
-  case htype_cc:
-  return rewrite_one_header(h, rewrite_cc, routed_old, routed_new,
-    rewrite_rules, existflags, replace);
-
-  case htype_bcc:
-  return rewrite_one_header(h, rewrite_bcc, routed_old, routed_new,
-    rewrite_rules, existflags, replace);
-
-  case htype_reply_to:
-  return rewrite_one_header(h, rewrite_replyto, routed_old, routed_new,
-    rewrite_rules, existflags, replace);
+  case htype_sender:    flag = rewrite_sender;    break;
+  case htype_from:    flag = rewrite_from;    break;
+  case htype_to:    flag = rewrite_to;    break;
+  case htype_cc:    flag = rewrite_cc;    break;
+  case htype_bcc:    flag = rewrite_bcc;    break;
+  case htype_reply_to:    flag = rewrite_replyto;    break;
+  default:        return NULL;
   }
-
-return NULL;
+return rewrite_one_header(h, flag, routed_old, routed_new,
+  rewrite_rules, existflags, replace);
 }



diff --git a/test/runtest b/test/runtest
index 9effe34..7ad54e2 100755
--- a/test/runtest
+++ b/test/runtest
@@ -1263,6 +1263,9 @@ RESET_AFTER_EXTRA_LINE_READ:
     # TLS resumption is not always supported by the build
     next if /in tls_resumption_hosts\?/;


+    # Platform differences in errno strings
+    s/  SMTP\(Operation timed out\)<</  SMTP(Connection timed out)<</;
+
     # When Exim is checking the size of directories for maildir, it uses
     # the check_dir_size() function to scan directories. Of course, the order
     # of the files that are obtained using readdir() varies from system to