]> de.git.xonotic.org Git - xonotic/gmqcc.git/commitdiff
Fix the -fcorrect-logic condition
authorWolfgang Bumiller <blub@speed.at>
Thu, 20 Dec 2012 19:40:59 +0000 (20:40 +0100)
committerWolfgang Bumiller <blub@speed.at>
Thu, 20 Dec 2012 19:40:59 +0000 (20:40 +0100)
parser.c

index 4251d0213f317b0f10068c69e966aab07ce824b8..123241f17c9d4c19a7505a3eae7f7dae5f698f8e 100644 (file)
--- a/parser.c
+++ b/parser.c
@@ -1910,8 +1910,10 @@ static ast_expression* process_condition(parser_t *parser, ast_expression *cond,
         }
         ifnot = !ifnot;
     }
-    if (OPTS_FLAG(CORRECT_LOGIC)) {
-        /* everything must use a NOT_ */
+    if (OPTS_FLAG(CORRECT_LOGIC) &&
+        !(cond->expression.vtype == TYPE_STRING && OPTS_FLAG(TRUE_EMPTY_STRINGS)))
+    {
+        /* non-floats need to use NOT; except for strings on -ftrue-empty-strings */
         unary = (ast_unary*)cond;
         if (!ast_istype(cond, ast_unary) || unary->op < INSTR_NOT_F || unary->op > INSTR_NOT_FNC)
         {