summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPhilip Hazel <ph10@hermes.cam.ac.uk>2005-08-23 08:46:33 +0000
committerPhilip Hazel <ph10@hermes.cam.ac.uk>2005-08-23 08:46:33 +0000
commit5591031bc256369573a91bc8f5f6a96d031b96b3 (patch)
treeede7d9927fe2a47f13948b85f1e4ff1e5d82d068 /src
parent5dd9625b6653667ecf90dae1b1a25e67940e2fbb (diff)
Add % operator to ${eval expansion.
Diffstat (limited to 'src')
-rw-r--r--src/ACKNOWLEDGMENTS5
-rw-r--r--src/src/expand.c8
2 files changed, 8 insertions, 5 deletions
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;