diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2016-11-18 06:10:12 +0200 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2016-11-18 06:10:12 +0200 |
commit | dc7bf0cfeb2ec3eb26f1767cfe8605199613c4d6 (patch) | |
tree | f2d6dcac2918d00cd31dd2dded7a776de7fa277e /node.c | |
parent | f0b405cceab16dadbb84b95a8d68f705bc20f70f (diff) | |
parent | c2448a50be949f5df2da4f7a1baf58358b297970 (diff) | |
download | egawk-dc7bf0cfeb2ec3eb26f1767cfe8605199613c4d6.tar.gz egawk-dc7bf0cfeb2ec3eb26f1767cfe8605199613c4d6.tar.bz2 egawk-dc7bf0cfeb2ec3eb26f1767cfe8605199613c4d6.zip |
Merge branch 'master' into feature/typed-regex-2
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; /* |