diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2016-11-18 06:02:42 +0200 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2016-11-18 06:02:42 +0200 |
commit | df9a742bd1404327432e60607842edd1ebd72184 (patch) | |
tree | f8cadf084890699b797817e335b7915f718a1db4 /node.c | |
parent | dad49da0e8e738ad9380379571e5771704c50dc1 (diff) | |
parent | c2448a50be949f5df2da4f7a1baf58358b297970 (diff) | |
download | egawk-df9a742bd1404327432e60607842edd1ebd72184.tar.gz egawk-df9a742bd1404327432e60607842edd1ebd72184.tar.bz2 egawk-df9a742bd1404327432e60607842edd1ebd72184.zip |
Merge branch 'master' into feature/cmake
Diffstat (limited to 'node.c')
-rw-r--r-- | node.c | 14 |
1 files changed, 7 insertions, 7 deletions
@@ -67,9 +67,9 @@ r_force_number(NODE *n) return n; /* - * We should always set NUMCUR and clear MAYBE_NUM, and we may possibly - * change STRING to NUMBER if MAYBE_NUM was set and it's a good numeric - * string. + * We should always set NUMCUR. If USER_INPUT is set and it's a + * numeric string, we clear STRING and enable NUMBER, but if it's not + * numeric, we disable USER_INPUT. */ /* All the conditionals are an attempt to avoid the expensive strtod */ @@ -159,12 +159,13 @@ r_force_number(NODE *n) /* fall through to badnum */ } badnum: - n->flags &= ~MAYBE_NUM; + n->flags &= ~USER_INPUT; return n; goodnum: - if ((n->flags & MAYBE_NUM) != 0) { - n->flags &= ~(MAYBE_NUM|STRING); + if ((n->flags & USER_INPUT) != 0) { + /* leave USER_INPUT enabled to indicate that this is a strnum */ + n->flags &= ~STRING; n->flags |= NUMBER; } return n; @@ -300,7 +301,6 @@ r_dupnode(NODE *n) getnode(r); *r = *n; - r->flags &= ~FIELD; r->flags |= MALLOC; r->valref = 1; /* |