xref: /illumos-gate/usr/src/test/util-tests/tests/awk/gnu/zeroe0.awk (revision e6d6c189fa3a95d7aa27bbe0aeacf7c1a6b57c8c)
1*e6d6c189SCody Peter Mello# From sbohdjal@matrox.com  Tue Dec 31 11:41:25 2002
2*e6d6c189SCody Peter Mello# Return-Path: <sbohdjal@matrox.com>
3*e6d6c189SCody Peter Mello# X-From_: sbohdjal@matrox.com Mon Dec 30 17:34:41 2002
4*e6d6c189SCody Peter Mello# Message-Id: <4.3.1.1.20021230101824.00fc4bd8@mailbox.matrox.com>
5*e6d6c189SCody Peter Mello# Date: Mon, 30 Dec 2002 10:33:10 -0500
6*e6d6c189SCody Peter Mello# To: bug-gawk@gnu.org
7*e6d6c189SCody Peter Mello# From: Serge Bohdjalian <sbohdjal@matrox.com>
8*e6d6c189SCody Peter Mello# Subject: GAWK 3.1.1 bug, DJGPP port
9*e6d6c189SCody Peter Mello#
10*e6d6c189SCody Peter Mello# When I run the following AWK file...
11*e6d6c189SCody Peter Mello#
12*e6d6c189SCody Peter MelloBEGIN {
13*e6d6c189SCody Peter Mello    $0 = "00E0";
14*e6d6c189SCody Peter Mello    print $0 ", " ($0 && 1) ", " ($0 != "");
15*e6d6c189SCody Peter Mello    $1 = "00E0";
16*e6d6c189SCody Peter Mello    print $1 ", " ($1 && 1) ", " ($1 != "");
17*e6d6c189SCody Peter Mello}
18*e6d6c189SCody Peter Mello#
19*e6d6c189SCody Peter Mello# With the SimTel version of GAWK 3.1.1 for Windows (downloadable from
20*e6d6c189SCody Peter Mello# ftp://ftp.cdrom.com/pub/simtelnet/gnu/djgpp/v2gnu/), I get the following
21*e6d6c189SCody Peter Mello# output...
22*e6d6c189SCody Peter Mello#
23*e6d6c189SCody Peter Mello# 00E0, 0, 1
24*e6d6c189SCody Peter Mello# 00E0, 1, 1
25*e6d6c189SCody Peter Mello#
26*e6d6c189SCody Peter Mello# With the Cygwin version of GAWK 3.1.1 for Windows, I get...
27*e6d6c189SCody Peter Mello#
28*e6d6c189SCody Peter Mello# 00E0, 1, 1
29*e6d6c189SCody Peter Mello# 00E0, 1, 1
30*e6d6c189SCody Peter Mello#
31*e6d6c189SCody Peter Mello# As far as I know, if "$0" isn't blank, the value of "($0 && 1)" should be
32*e6d6c189SCody Peter Mello# "1" (true). I get the same problem if I substitute "00E0" with "00E1" to
33*e6d6c189SCody Peter Mello# "00E9". Other strings don't have have this problem (for example, "00EA").
34*e6d6c189SCody Peter Mello# The problem occurs whether I use file input or whether I manually assign
35*e6d6c189SCody Peter Mello# "$0" (as above).
36*e6d6c189SCody Peter Mello#
37*e6d6c189SCody Peter Mello# The problem is also discussed in a comp.lang.awk posting ("Bug in GAWK
38*e6d6c189SCody Peter Mello# 3.1.1?", Dec. 27, 2002).
39*e6d6c189SCody Peter Mello#
40*e6d6c189SCody Peter Mello# -Serge
41