Fix ACL "condition =" for negative number values. Bug 1005
[exim.git] / src / src / acl.c
index fd958aa3951d62ed0e4de3e24c280769d9dc4313..4fda03b77b03e8b21e3931a4a704a69d5f814dac 100644 (file)
@@ -3103,7 +3103,9 @@ for (; cb != NULL; cb = cb->next)
     /* The true/false parsing here should be kept in sync with that used in
     expand.c when dealing with ECOND_BOOL so that we don't have too many
     different definitions of what can be a boolean. */
-    if (Ustrspn(arg, "0123456789") == Ustrlen(arg))     /* Digits, or empty */
+    if (*arg == '-'
+       ? Ustrspn(arg+1, "0123456789") == Ustrlen(arg+1)    /* Negative number */
+       : Ustrspn(arg,   "0123456789") == Ustrlen(arg))     /* Digits, or empty */
       rc = (Uatoi(arg) == 0)? FAIL : OK;
     else
       rc = (strcmpic(arg, US"no") == 0 ||