bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Bug in gawk 3.1.4


From: Bruce Lilly
Subject: Bug in gawk 3.1.4
Date: Wed, 24 Nov 2004 21:11:06 -0500
User-agent: KMail/1.7.1

Hello,

I found a bug when running Jon Bentley's dformat awk script (CSTR 142).
All tests described below on SuSE Linux 9.1 Professional, gawk built from
source using gcc 3.4.3, bison 1.875d (both also built from source). Gawk
passes make check "ALL TESTS PASSED".

I have attached a simplified awk script and test data file.

The simplified script when run on the simple data file shows a bug in
gawk pattern matching.  The same script and data with "the one
true awk" from Brian Kernighan's web site, also built from source,
same compiler, etc. works fine:

marty:/src/gawk/gawk-3.1.4 # ./gawk -f awktest data
line begins with non-whitespace: left
line begins with whitespace:  space
line begins with whitespace:    tab
line begins with whitespace: left
line begins with whitespace:  space
line begins with whitespace:    tab
marty:/src/gawk/gawk-3.1.4 # /usr/bin/awk -f awktest data
line begins with non-whitespace: left
line begins with whitespace:  space
line begins with whitespace:    tab
line begins with non-whitespace: left
line begins with whitespace:  space
line begins with whitespace:    tab

I haven't determined precisely where the bug is, but it's clear that
there is a bug.  Note that gawk fails to match the second line
which begins with a non-whitespace character to the input
pattern /^[^ \t]/.

Best regards,
  Bruce Lilly

Attachment: awktest
Description: Text document

Attachment: data
Description: Text document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]