X-Git-Url: https://jxself.org/git/?a=blobdiff_plain;f=config%2Fexpr.c;h=ee23ebc881a67e08f592606c5e1d53929eb362d4;hb=66f295a0e38d549f4b04a3ff7068586fb8216e24;hp=667d1aa237114453c28bafac618e9552405a19c4;hpb=b049eebc30b8654df29be2960f85762f679a6699;p=carl9170fw.git diff --git a/config/expr.c b/config/expr.c index 667d1aa..ee23ebc 100644 --- a/config/expr.c +++ b/config/expr.c @@ -113,7 +113,7 @@ void expr_free(struct expr *e) break; case E_NOT: expr_free(e->left.expr); - return; + break; case E_EQUAL: case E_GEQ: case E_GTH: @@ -893,7 +893,10 @@ static enum string_value_kind expr_parse_string(const char *str, switch (type) { case S_BOOLEAN: case S_TRISTATE: - return k_string; + val->s = !strcmp(str, "n") ? 0 : + !strcmp(str, "m") ? 1 : + !strcmp(str, "y") ? 2 : -1; + return k_signed; case S_INT: val->s = strtoll(str, &tail, 10); kind = k_signed; @@ -1113,7 +1116,7 @@ void expr_print(struct expr *e, void (*fn)(void *, struct symbol *, const char * fn(data, e->left.sym, e->left.sym->name); else fn(data, NULL, ""); - fn(data, NULL, e->type == E_LEQ ? ">=" : ">"); + fn(data, NULL, e->type == E_GEQ ? ">=" : ">"); fn(data, e->right.sym, e->right.sym->name); break; case E_UNEQUAL: