diff options
author | Andrew J. Schorr <aschorr@telemetry-investments.com> | 2015-04-16 12:44:14 -0400 |
---|---|---|
committer | Andrew J. Schorr <aschorr@telemetry-investments.com> | 2015-04-16 12:44:14 -0400 |
commit | 58dc708e3faa4aa46f81578a9a0ace4f0f7cad69 (patch) | |
tree | 82a3ac6b82bc718054313495e629d3d270a90e43 /node.c | |
parent | aaa85643b352f867cfe7198f313b4481ad1f544d (diff) | |
parent | e934ad609d3639152324a4211857d87f228cf938 (diff) | |
download | egawk-58dc708e3faa4aa46f81578a9a0ace4f0f7cad69.tar.gz egawk-58dc708e3faa4aa46f81578a9a0ace4f0f7cad69.tar.bz2 egawk-58dc708e3faa4aa46f81578a9a0ace4f0f7cad69.zip |
Merge branch 'gawk-4.1-stable'
Diffstat (limited to 'node.c')
-rw-r--r-- | node.c | 15 |
1 files changed, 12 insertions, 3 deletions
@@ -138,11 +138,20 @@ r_force_number(NODE *n) ptr++; *cpend = save; finish: - if (errno == 0 && ptr == cpend) { - n->flags |= newflags; - n->flags |= NUMCUR; + if (errno == 0) { + if (ptr == cpend) { + n->flags |= newflags; + n->flags |= NUMCUR; + } + /* else keep the leading numeric value without updating flags */ } else { errno = 0; + /* + * N.B. For subnormal values, strtod may return the + * floating-point representation while setting errno to ERANGE. + * We force the numeric value to 0 in such cases. + */ + n->numbr = 0; } return n; |