From kh@mogami-wire.co.jp  Sat Dec 16 18:40:24 2000
Return-Path: <kh@mogami-wire.co.jp>
Received: from eve.mogami-wire.co.jp (eve.mogami-wire.co.jp [210.161.93.162])
	by hub.freebsd.org (Postfix) with ESMTP id 1494C37B400
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 16 Dec 2000 18:40:23 -0800 (PST)
Received: (from uucp@localhost)
	by eve.mogami-wire.co.jp (8.8.8/3.6W-eve) with UUCP id LAA20112
	for FreeBSD-gnats-submit@freebsd.org; Sun, 17 Dec 2000 11:40:21 +0900 (JST)
Received: (from kh@localhost)
	by poem.mogami-wire.co.jp (8.9.3/3.7W-uucp) id LAA02442;
	Sun, 17 Dec 2000 11:33:12 +0900 (JST)
Message-Id: <200012170233.LAA02442@poem.mogami-wire.co.jp>
Date: Sun, 17 Dec 2000 11:33:12 +0900 (JST)
From: Kouichi Hirabayashi <kh@mogami-wire.co.jp>
Reply-To: kh@mogami-wire.co.jp
To: FreeBSD-gnats-submit@freebsd.org
Subject: possible fix to awk(1)
X-Send-Pr-Version: 3.2

>Number:         23593
>Category:       gnu
>Synopsis:       [patch] possible fix to awk(1)
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    obrien
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Dec 16 18:50:00 PST 2000
>Closed-Date:    Wed Jun 19 10:03:05 PDT 2002
>Last-Modified:  Wed Jun 19 10:03:05 PDT 2002
>Originator:     
>Release:        
>Organization:
>Environment:
>Description:
 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 */
 
 
 
>How-To-Repeat:
>Fix:
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: gnats-admin->freebsd-bugs 
Responsible-Changed-By: billf 
Responsible-Changed-When: Mon Feb 26 13:57:45 PST 2001 
Responsible-Changed-Why:  
refiled damaged PR. (pending->gnu) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=23593 
Responsible-Changed-From-To: freebsd-bugs->obrien 
Responsible-Changed-By: phk 
Responsible-Changed-When: Tue May 29 02:38:52 PDT 2001 
Responsible-Changed-Why:  
This should be reported back to the gawk people I guess ? 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=23593 

From: Zak Johnson <zakj@nox.cx>
To: freebsd-gnats-submit@FreeBSD.org, kh@mogami-wire.co.jp
Cc:  
Subject: Re: gnu/23593: [patch] possible fix to awk(1)
Date: Wed, 19 Jun 2002 10:22:00 -0400

 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 
State-Changed-By: obrien 
State-Changed-When: Wed Jun 19 10:02:44 PDT 2002 
State-Changed-Why:  
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. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=23593 
>Unformatted:
