On Fri, 3 Jun 2005, [iso-8859-2] RafaB Kupka wrote:
> Sometimes def:acl_xx returns false even if variable has a value.
It turns out that this is a very long-standing bug. The code thought
that "0" should be treated as false for an "${if def:variable" test, but
the documentation has never said this (I have checked back to release
1.62). Therefore, I have made the code agree with the documentation. The
patch for 4.51 is below.
Philip
--
Philip Hazel University of Cambridge Computing Service,
ph10@??? Cambridge, England. Phone: +44 1223 334714.
*** exim-4.51/src/expand.c Wed May 4 12:35:39 2005
--- expand.c Tue Jun 7 11:08:59 2005
***************
*** 1631,1638 ****
string_sprintf("unknown variable \"%s\" after \"def:\"", name);
return NULL;
}
! if (yield != NULL)
! *yield = (value[0] != 0 && Ustrcmp(value, "0") != 0) == testfor;
}
return s;
--- 1635,1641 ----
string_sprintf("unknown variable \"%s\" after \"def:\"", name);
return NULL;
}
! if (yield != NULL) *yield = (value[0] != 0) == testfor;
}
return s;