diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2015-04-26 22:39:23 +0300 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2015-04-26 22:39:23 +0300 |
commit | 043cc39d1352ab67d5b5de3b2991bd422e6c44b3 (patch) | |
tree | c1d162c244bef431aa35eedd6b151f2bf472b640 /node.c | |
parent | 56073f0c0343be08ea16b1ea6b34715eacc89a05 (diff) | |
parent | 1770ada8bd6e72dfd3138d72cd6049edca79a4f5 (diff) | |
download | egawk-043cc39d1352ab67d5b5de3b2991bd422e6c44b3.tar.gz egawk-043cc39d1352ab67d5b5de3b2991bd422e6c44b3.tar.bz2 egawk-043cc39d1352ab67d5b5de3b2991bd422e6c44b3.zip |
Merge branch 'master' into feature/shadow-builtins
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; |