[gnu.utils.bug] Bug in Gawk 2.10 Beta

rms@AI.MIT.EDU (05/11/89)

Return-Path: <olender@rachmaninov.cs.colostate.edu>
Date: Tue, 9 May 89 21:33:41 MDT
X-Mailer: Mail User's Shell (6.5 4/17/89)
From: olender@rachmaninov.cs.colostate.edu (Kurt Olender)
To: bug-gnu-emacs@prep.ai.mit.edu
Subject: Bug in Gawk 2.10 Beta

I have no other address for reporting bugs for gawk.  
bug-gnu-gawk (my best guess) fails.
Please forward to the appropriate person.


I am using Gawk 2.10 Beta on a Sun 3/50 running SunOS 4.0

The following program works incorrectly under gawk, but correctly
under the awk provided with my system.

# Print a histogram from a file of data, one item per line
NR == 1 {imin = imax = $1}
	{
	    value[$1] = value[$1] "*"
	    if (imin > $1) imin = $1
	    if (imax < $1) imax = $1
	}
END 	{  for(i=imin; i<=imax; i++) printf("%5d |%s\n",i,value[i]) }

gawk matches the first pattern, but never the (omitted) second, thus printing
out an incorrect histogram.

Example:  with data file

90
80
70

gawk  prints

90 |