diff options
author | Andrew J. Schorr <aschorr@telemetry-investments.com> | 2016-06-14 16:35:48 -0400 |
---|---|---|
committer | Andrew J. Schorr <aschorr@telemetry-investments.com> | 2016-06-14 16:35:48 -0400 |
commit | 5826beec258141776469c5fd9b703d52c81a35fb (patch) | |
tree | 2d09f31301c392fa15218d5f133a19f4cfdb5fdb /eval.c | |
parent | 56b1798777fe5464014fca3f9744ebdb950b8348 (diff) | |
download | gawk-5826beec258141776469c5fd9b703d52c81a35fb.tar.gz |
Add a new boolval function to awk.h to make sure we handle this consistently.
Diffstat (limited to 'eval.c')
-rw-r--r-- | eval.c | 17 |
1 files changed, 3 insertions, 14 deletions
@@ -692,7 +692,6 @@ void set_IGNORECASE() { static bool warned = false; - NODE *n; if ((do_lint || do_traditional) && ! warned) { warned = true; @@ -701,13 +700,8 @@ set_IGNORECASE() load_casetable(); if (do_traditional) IGNORECASE = false; - else { - n = fixtype(IGNORECASE_node->var_value); - if ((n->flags & NUMBER) != 0) - IGNORECASE = ! iszero(n); - else - IGNORECASE = (n->stlen > 0); - } + else + IGNORECASE = boolval(IGNORECASE_node->var_value); set_RS(); /* set_RS() calls set_FS() if need be, for us */ } @@ -1517,12 +1511,7 @@ eval_condition(NODE *t) if (t == node_Boolean[true]) return true; - (void) fixtype(t); - - if ((t->flags & NUMBER) != 0) - return ! iszero(t); - - return (t->stlen != 0); + return boolval(t); } /* cmp_scalars -- compare two nodes on the stack */ |