From 5591031bc256369573a91bc8f5f6a96d031b96b3 Mon Sep 17 00:00:00 2001 From: Philip Hazel Date: Tue, 23 Aug 2005 08:46:33 +0000 Subject: [PATCH] Add % operator to ${eval expansion. --- doc/doc-txt/ChangeLog | 4 +++- src/ACKNOWLEDGMENTS | 5 +++-- src/src/expand.c | 8 +++++--- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/doc/doc-txt/ChangeLog b/doc/doc-txt/ChangeLog index 8eddabf4b..2b51e62f2 100644 --- a/doc/doc-txt/ChangeLog +++ b/doc/doc-txt/ChangeLog @@ -1,4 +1,4 @@ -$Cambridge: exim/doc/doc-txt/ChangeLog,v 1.208 2005/08/22 15:28:20 ph10 Exp $ +$Cambridge: exim/doc/doc-txt/ChangeLog,v 1.209 2005/08/23 08:46:33 ph10 Exp $ Change log file for Exim from version 4.21 ------------------------------------------- @@ -112,6 +112,8 @@ PH/26 Exim was recognizing IPv6 addresses of the form [IPv6:....] in EHLO client host address. Thus, it would show the EHLO address in Received: header lines when this was not necessary. +PH/27 Added the % operator to ${eval:}. + Exim version 4.52 ----------------- diff --git a/src/ACKNOWLEDGMENTS b/src/ACKNOWLEDGMENTS index cd9c597d0..9acc51b3c 100644 --- a/src/ACKNOWLEDGMENTS +++ b/src/ACKNOWLEDGMENTS @@ -1,4 +1,4 @@ -$Cambridge: exim/src/ACKNOWLEDGMENTS,v 1.31 2005/08/22 10:49:04 ph10 Exp $ +$Cambridge: exim/src/ACKNOWLEDGMENTS,v 1.32 2005/08/23 08:46:33 ph10 Exp $ EXIM ACKNOWLEDGEMENTS @@ -20,7 +20,7 @@ relatively small patches. Philip Hazel Lists created: 20 November 2002 -Last updated: 29 July 2005 +Last updated: 23 August 2005 THE OLD LIST @@ -151,6 +151,7 @@ Steve Haslam Lots of stuff, including HMAC computations Better error messages for BDB Sheldon Hearn Suggested patch for smtp_accept_max_nonmail_hosts +Jakob Hirsch Patch for % operator Kjetil Torgrim Homme Patch for require_files problem on NFS file systems Tom Hughes Suggested patch for $n bug in pipe command from filter Pierre Humblet Continued Cygwin support diff --git a/src/src/expand.c b/src/src/expand.c index 25e286390..273f2a507 100644 --- a/src/src/expand.c +++ b/src/src/expand.c @@ -1,4 +1,4 @@ -/* $Cambridge: exim/src/src/expand.c,v 1.40 2005/08/08 09:57:29 ph10 Exp $ */ +/* $Cambridge: exim/src/src/expand.c,v 1.41 2005/08/23 08:46:33 ph10 Exp $ */ /************************************************* * Exim - an Internet mail transport agent * @@ -2749,12 +2749,14 @@ uschar *s = *sptr; int x = eval_term(&s, decimal, error); if (*error == NULL) { - while (*s == '*' || *s == '/') + while (*s == '*' || *s == '/' || *s == '%') { int op = *s++; int y = eval_term(&s, decimal, error); if (*error != NULL) break; - if (op == '*') x *= y; else x /= y; + if (op == '*') x *= y; + else if (op == '/') x /= y; + else x %= y; } } *sptr = s; -- 2.30.2