| Summary: | [patch] possible fix to awk(1) | ||
|---|---|---|---|
| Product: | Base System | Reporter: | kh <kh> |
| Component: | gnu | Assignee: | David E. O'Brien <obrien> |
| Status: | Closed FIXED | ||
| Severity: | Affects Only Me | ||
| Priority: | Normal | ||
| Version: | 1.0-RELEASE | ||
| Hardware: | Any | ||
| OS: | Any | ||
Responsible Changed From-To: gnats-admin->freebsd-bugs refiled damaged PR. (pending->gnu) Responsible Changed From-To: freebsd-bugs->obrien This should be reported back to the gawk people I guess ? This PR can be closed. A similar patch has been committed as of contrib/awk/builtin.c revision 1.1.1.3, and the sample script's output is now correct. -Zak State Changed From-To: open->closed similar patch has been committed as of contrib/awk/builtin.c revision 1.1.1.3, and the sample script's output is now correct. |
Submitter-Id: current-users Originator: Kouichi Hirabayashi Organization: Mogami Wire & Cable Corp. Confidential: no Synopsis: The printf function of awk(1) does not work correctly. Severity: non-critical Priority: low Category: gnu Release: FreeBSD 3.4-RELEASE i386 Class: sw-bug Environment: any Description: Here is a sample script to show this problem. /usr/bin/awk ' BEGIN { x = 123 printf "%6.0f %06.1f\n", x, x print "must be printed as" printf "%6d %06.1f\n", x, x exit 0 }' How-To-Repeat: Execute above script. Fix: *** /usr/src/contrib/awk/ORGbuiltin.c Sun Dec 17 11:00:28 2000 --- /usr/src/contrib/awk/builtin.c Sun Dec 17 11:01:07 2000 *************** *** 463,469 **** break; case '0': ! zero_flag = TRUE; if (lj) goto retry; /* FALL through */ --- 463,470 ---- break; case '0': ! if (!have_prec) ! zero_flag = TRUE; if (lj) goto retry; /* FALL through */