-$Cambridge: exim/doc/doc-txt/ChangeLog,v 1.558 2008/12/12 14:44:25 nm4 Exp $
+$Cambridge: exim/doc/doc-txt/ChangeLog,v 1.559 2008/12/12 14:51:47 nm4 Exp $
Change log file for Exim from version 4.21
-------------------------------------------
NM/10 Bugzilla 770: Problem on some platforms modifying the len parameter to accept()
Patch provided by Maxim Dounin
+NM/11 Bugzilla 749: Preserve old behaviour of blanks comparing equal to zero.
+ Patch provided by Phil Pennock
+
Exim version 4.69
-----------------
-/* $Cambridge: exim/src/src/expand.c,v 1.96 2008/08/07 11:05:03 fanf2 Exp $ */
+/* $Cambridge: exim/src/src/expand.c,v 1.97 2008/12/12 14:51:47 nm4 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
errno = 0;
expand_string_message = NULL; /* Indicates no error */
+
+/* Before Exim 4.64, strings consisting entirely of whitespace compared
+equal to 0. Unfortunately, people actually relied upon that, so preserve
+the behaviour explicitly. Stripping leading whitespace is a harmless
+noop change since strtol skips it anyway (provided that there is a number
+to find at all). */
+if (isspace(*s))
+ {
+ while (isspace(*s)) ++s;
+ if (*s == '\0')
+ {
+ DEBUG(D_expand)
+ debug_printf("treating blank string as number 0\n");
+ return 0;
+ }
+ }
+
value = strtol(CS s, CSS &endptr, 10);
if (endptr == s)