summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSheldon Hearn <sheldonh@FreeBSD.org>1999-12-23 18:24:31 +0000
committerSheldon Hearn <sheldonh@FreeBSD.org>1999-12-23 18:24:31 +0000
commit7dfb2a976022777d0cd59c07852836b738b79ccc (patch)
treeefbc3761686ed5ff1dcaa6ff4bd4aa17b786d2b0
parent58f9831e329c926bd0507b76194bf8921fb53193 (diff)
Notes
-rw-r--r--contrib/awk/builtin.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/contrib/awk/builtin.c b/contrib/awk/builtin.c
index 0fee05459a2a1..3de6f2ecddd04 100644
--- a/contrib/awk/builtin.c
+++ b/contrib/awk/builtin.c
@@ -463,7 +463,13 @@ check_pos:
break;
case '0':
- zero_flag = TRUE;
+ /*
+ * Only turn on zero_flag if we haven't seen
+ * the field width or precision yet. Otherwise,
+ * screws up floating point formatting.
+ */
+ if (cur == & fw)
+ zero_flag = TRUE;
if (lj)
goto retry;
/* FALL through */
@@ -2006,7 +2012,7 @@ NODE *tree;
free_temp(tmp);
if (do_lint) {
- if (uval < 0)
+ if (d < 0)
warning("compl(%lf): negative value will give strange results", d);
if (double_to_int(d) != d)
warning("compl(%lf): fractional value will be truncated", d);