aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2015-09-04 14:37:15 +0300
committerArnold D. Robbins <arnold@skeeve.com>2015-09-04 14:37:15 +0300
commit2b7501cc7c765b22c893409b4087b31fdbd9ac14 (patch)
treeaccb7eff8ba3c928042066dedd36ea919c16fc2d
parent0d974ba125c1e8df68fecc2f579bb067d056cc3f (diff)
parent26ab51cc70109abd04ac04ff75bb58abb2eb957f (diff)
downloadegawk-2b7501cc7c765b22c893409b4087b31fdbd9ac14.tar.gz
egawk-2b7501cc7c765b22c893409b4087b31fdbd9ac14.tar.bz2
egawk-2b7501cc7c765b22c893409b4087b31fdbd9ac14.zip
Merge branch 'gawk-4.1-stable'
-rw-r--r--ChangeLog5
-rw-r--r--profile.c16
-rw-r--r--test/ChangeLog4
-rw-r--r--test/profile5.ok2
4 files changed, 23 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index f80edb7f..e076c3e2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2015-09-04 Arnold D. Robbins <arnold@skeeve.com>
+
+ * profile.c (pp_num): Use format_val to print integral values
+ as integers. Thanks to Hermann Peifer for the report.
+
2015-08-25 Arnold D. Robbins <arnold@skeeve.com>
* node.c (str2wstr): Upon finding an invalid character, if
diff --git a/profile.c b/profile.c
index 90f01c07..f5bcf8c5 100644
--- a/profile.c
+++ b/profile.c
@@ -1459,9 +1459,19 @@ pp_number(NODE *n)
} else
#endif
{
- count = PP_PRECISION + 10;
- emalloc(str, char *, count, "pp_number");
- sprintf(str, "%0.*g", PP_PRECISION, n->numbr);
+ /* Use format_val() to get integral values printed as integers */
+ NODE *s;
+
+ getnode(s);
+ *s = *n;
+ s->flags &= ~STRCUR;
+
+ s = r_format_val("%.6g", 0, s);
+
+ s->stptr[s->stlen] = '\0';
+ str = s->stptr;
+
+ freenode(s);
}
return str;
diff --git a/test/ChangeLog b/test/ChangeLog
index 736860db..6df641be 100644
--- a/test/ChangeLog
+++ b/test/ChangeLog
@@ -1,3 +1,7 @@
+2015-09-04 Arnold D. Robbins <arnold@skeeve.com>
+
+ * profile.ok: Updated after code change.
+
2015-08-25 Arnold D. Robbins <arnold@skeeve.com>
* mbstr1.ok: Updated after code change.
diff --git a/test/profile5.ok b/test/profile5.ok
index 5bf04dcf..d6e8d1b5 100644
--- a/test/profile5.ok
+++ b/test/profile5.ok
@@ -3662,7 +3662,7 @@ function _mac_init()
_MACPFX84SFX["\204"] = "_macpfx84"
_MACPFX84SFX["\224"] = "_macsfx94"
_MACPFX84SFX[""] = "_mpusfxsubret"
- _VLDMAXSTRING = 1e+06
+ _VLDMAXSTRING = 1000000
}
function _macpfx84(F, D, C, p1, p2, p3)