diff options
author | Jeremy Harris <jgh146exb@wizmail.org> | 2014-03-18 16:17:56 +0000 |
---|---|---|
committer | Jeremy Harris <jgh146exb@wizmail.org> | 2014-03-18 16:17:56 +0000 |
commit | 51c7471d48efd62b2d4f5647782ba1e849d4c35a (patch) | |
tree | 323eabb37195a668a90e7100a02b6879fb340861 /src | |
parent | 6681531ad79b73f4e811037481a0055ace41e46d (diff) |
Fix ACL "condition =" for negative number values. Bug 1005
Fix conditional "bool{<string>}" for negative number values, to match.
Diffstat (limited to 'src')
-rw-r--r-- | src/src/acl.c | 4 | ||||
-rw-r--r-- | src/src/expand.c | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/src/src/acl.c b/src/src/acl.c index fd958aa39..4fda03b77 100644 --- a/src/src/acl.c +++ b/src/src/acl.c @@ -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 || diff --git a/src/src/expand.c b/src/src/expand.c index bd097db43..64a3a86e6 100644 --- a/src/src/expand.c +++ b/src/src/expand.c @@ -2849,7 +2849,9 @@ switch(cond_type) be no maintenance burden from replicating it. */ if (len == 0) boolvalue = FALSE; - else if (Ustrspn(t, "0123456789") == len) + else if (*t == '-' + ? Ustrspn(t+1, "0123456789") == len-1 + : Ustrspn(t, "0123456789") == len) { boolvalue = (Uatoi(t) == 0) ? FALSE : TRUE; /* expand_check_condition only does a literal string "0" check */ |