diff options
Diffstat (limited to 'builtin.c')
-rw-r--r-- | builtin.c | 12 |
1 files changed, 9 insertions, 3 deletions
@@ -3,7 +3,7 @@ */ /* - * Copyright (C) 1986, 1988, 1989, 1991-1999 the Free Software Foundation, Inc. + * Copyright (C) 1986, 1988, 1989, 1991-2000 the Free Software Foundation, Inc. * * This file is part of GAWK, the GNU implementation of the * AWK Programming Language. @@ -459,7 +459,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 */ @@ -1998,7 +2004,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); |