summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPhilip Hazel <ph10@hermes.cam.ac.uk>2005-04-28 13:29:27 +0000
committerPhilip Hazel <ph10@hermes.cam.ac.uk>2005-04-28 13:29:27 +0000
commitd20976dcb3ce18e398bf9b8bd8171fc67fa7aada (patch)
treecb57fa36716b9c864aac4cc3d8498b1370cff86c /src
parent4e714aedb0e553ea99482f60d8d5d857b1942922 (diff)
Make $value usable in the "else" part of ${run.
Diffstat (limited to 'src')
-rw-r--r--src/src/expand.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/src/expand.c b/src/src/expand.c
index b1f7d3f96..49686555e 100644
--- a/src/src/expand.c
+++ b/src/src/expand.c
@@ -1,4 +1,4 @@
-/* $Cambridge: exim/src/src/expand.c,v 1.19 2005/04/27 13:29:32 ph10 Exp $ */
+/* $Cambridge: exim/src/src/expand.c,v 1.20 2005/04/28 13:29:27 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
@@ -2333,8 +2333,8 @@ if (yes)
/* If this is called from a lookup or an extract, we want to restore $value to
what it was at the start of the item, so that it has this value during the
-second string expansion. For the call from "if" to this function, save_lookup
-is set to lookup_value, so that this statement does nothing. */
+second string expansion. For the call from "if" or "run" to this function,
+save_lookup is set to lookup_value, so that this statement does nothing. */
lookup_value = save_lookup;
@@ -3330,7 +3330,6 @@ while (*s != 0)
case EITEM_RUN:
{
FILE *f;
- uschar *old_lookup_value = NULL;
uschar *arg;
uschar **argv;
pid_t pid;
@@ -3410,18 +3409,17 @@ while (*s != 0)
in lookup_value). */
f = fdopen(fd_out, "rb");
- old_lookup_value = lookup_value;
lookup_value = NULL;
lookup_value = cat_file(f, lookup_value, &lsize, &lptr, NULL);
fclose(f);
}
- /* Process the yes/no strings */
+ /* Process the yes/no strings; $value may be useful in both cases */
switch(process_yesno(
skipping, /* were previously skipping */
runrc == 0, /* success/failure indicator */
- old_lookup_value, /* value to reset for string2 */
+ lookup_value, /* value to reset for string2 */
&s, /* input pointer */
&yield, /* output pointer */
&size, /* output size */