From 8826764d320fd6becbf62033e5563bff9612b77a Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Sun, 25 Sep 2016 00:59:40 +0200 Subject: init: change the values of the token conditions They were too short, TOK_COND_NEG conflicts with TOK_UNK, so negating an "ln" action will be confused with an unknown command. And negating "md" would be confused with an end of file. Let's use ranges 0x100 and above for conditions, they're transported in integers. --- init/init.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/init/init.c b/init/init.c index eb44fef..8b86fa2 100644 --- a/init/init.c +++ b/init/init.c @@ -334,10 +334,11 @@ enum { TOK_DOT, /* . : end of config */ TOK_UNK, /* unknown command */ TOK_EOF, /* end of file */ - TOK_COND_NEG = 0x20, /* negate the result before evaluation */ - TOK_COND_OR = 0x40, /* conditionnal OR */ - TOK_COND_AND = 0x80, /* conditionnal AND */ - TOK_COND = 0xE0, /* any condition */ + /* below are conditions which can be ORed with a token */ + TOK_COND_NEG = 0x100, /* negate the result before evaluation */ + TOK_COND_OR = 0x200, /* conditionnal OR */ + TOK_COND_AND = 0x400, /* conditionnal AND */ + TOK_COND = 0x700, /* any condition */ }; /* possible states for variable parsing */ -- 1.7.12.1