-$Cambridge: exim/doc/doc-txt/ChangeLog,v 1.30 2004/11/17 15:21:10 ph10 Exp $
+$Cambridge: exim/doc/doc-txt/ChangeLog,v 1.31 2004/11/17 16:12:26 ph10 Exp $
Change log file for Exim from version 4.21
-------------------------------------------
have increased the buffer size for the ${rfc2047: expansion operator from
1024 to 2048 bytes.
+33. It is now permitted to omit both strings after an "if" condition; if the
+ condition is true, the result is "true". As before, when the second string
+ is omitted, a false condition yields an empty string. This makes it less
+ cumbersome to write custom ACL and router conditions.
+
Exim version 4.43
-----------------
-$Cambridge: exim/doc/doc-txt/NewStuff,v 1.10 2004/11/17 14:32:25 ph10 Exp $
+$Cambridge: exim/doc/doc-txt/NewStuff,v 1.11 2004/11/17 16:12:26 ph10 Exp $
New Features in Exim
--------------------
to find the amount of free space (only true for experimental systems), the
space value is -1.
+11. It is now permitted to omit both strings after an "if" condition; if the
+ condition is true, the result is the string "true". As before, when the
+ second string is omitted, a false condition yields an empty string. This
+ makes it less cumbersome to write custom ACL and router conditions. For
+ example, instead of
+
+ condition = ${if eq {$acl_m4}{1}{yes}{no}}
+
+ or the shorter form
+
+ condition = ${if eq {$acl_m4}{1}{yes}}
+
+ (because the second string has always defaulted to ""), you can now write
+
+ condition = ${if eq {$acl_m4}{1}}
+
+ Previously this was a syntax error.
+
Version 4.43
------------
-/* $Cambridge: exim/src/src/expand.c,v 1.5 2004/11/17 15:21:10 ph10 Exp $ */
+/* $Cambridge: exim/src/src/expand.c,v 1.6 2004/11/17 16:12:26 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
uschar *sub1, *sub2;
/* If there are no following strings, we substitute the contents of $value for
-lookups and for extractions in the success case. In the fail case, nothing is
-substituted. In the case of "if", lack of following strings is an error. */
+lookups and for extractions in the success case. For the ${if item, the string
+"true" is substituted. In the fail case, nothing is substituted for all three
+items. */
while (isspace(*s)) s++;
if (*s == '}')
{
- if (type[0] == 'i') goto FAILED_CURLY;
- if (yes && lookup_value != NULL)
- *yieldptr = string_cat(*yieldptr, sizeptr, ptrptr, lookup_value,
- Ustrlen(lookup_value));
- lookup_value = save_lookup;
+ if (type[0] == 'i')
+ {
+ if (yes) *yieldptr = string_cat(*yieldptr, sizeptr, ptrptr, US"true", 4);
+ }
+ else
+ {
+ if (yes && lookup_value != NULL)
+ *yieldptr = string_cat(*yieldptr, sizeptr, ptrptr, lookup_value,
+ Ustrlen(lookup_value));
+ lookup_value = save_lookup;
+ }
s++;
goto RETURN;
}