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

olender@RACHMANINOV.CS.COLOSTATE.EDU (Kurt Olender) (05/10/89)

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 |