Cond !bool{}/!bool_lax{} did not negate. Fixed.
authorPhil Pennock <pdp@exim.org>
Tue, 26 Apr 2011 19:02:09 +0000 (15:02 -0400)
committerPhil Pennock <pdp@exim.org>
Tue, 26 Apr 2011 19:02:09 +0000 (15:02 -0400)
Fixes bug: 1104

doc/doc-txt/ChangeLog
src/src/expand.c
test/scripts/0000-Basic/0002

index e6684b4e371042f5c2b6ddc6485c7facd53265f9..7bf9ebbed585abaec204c495f33667401ada8bfd 100644 (file)
@@ -24,6 +24,9 @@ PP/06 Extra paranoia around buffer usage at the STARTTLS transition.
 PP/07 Catch divide-by-zero in ${eval:...}.
       Fixes bugzilla 1102.
 
+PP/08 Condition negation of bool{}/bool_lax{} did not negate.  Fixed.
+      Bugzilla 1104.
+
 
 Exim version 4.75
 -----------------
index fece8c150b4fc8e2e938106b150f24a3d9f42226..2e59c4084e8d16990a31ff851983c5916fff10ec 100644 (file)
@@ -2558,7 +2558,7 @@ switch(cond_type)
        "value \"%s\"", t);
       return NULL;
       }
-    if (yield != NULL) *yield = (boolvalue != 0);
+    if (yield != NULL) *yield = (boolvalue == testfor);
     return s;
     }
 
index 9e427ddb1e0ef3854f1cc8344b07784f22cd92f7..625050cefa99275637e1b89c354f30dd2a27cf62 100644 (file)
@@ -551,6 +551,8 @@ abcdea abc z   ${tr{abcdea}{abc}{z}}
 "text "               ${if bool{text }{true}{false}}     EXPECT: error
 " text "              ${if bool{ text }{true}{false}}     EXPECT: error
 "00"                  ${if bool{00}{true}{false}}     EXPECT: false
+"!true"               ${if !bool{true}{true}{false}}     EXPECT: false
+"!false"              ${if !bool{false}{true}{false}}     EXPECT: true
 
 "TrUe"                ${if bool_lax{TrUe}{true}{false}}      EXPECT: true
 "FALSE"               ${if bool_lax{FALSE}{true}{false}}     EXPECT: false
@@ -570,6 +572,8 @@ abcdea abc z   ${tr{abcdea}{abc}{z}}
 "text "               ${if bool_lax{text }{true}{false}}      EXPECT: true
 " text "              ${if bool_lax{ text }{true}{false}}      EXPECT: true
 "00"                  ${if bool_lax{00}{true}{false}}      EXPECT: true
+"!true"               ${if !bool_lax{true}{true}{false}}      EXPECT: false
+"!false"              ${if !bool_lax{false}{true}{false}}      EXPECT: true
 
 # RFC 2047