xref: /illumos-gate/usr/src/test/util-tests/tests/awk/gnu/nested.awk (revision e6d6c189fa3a95d7aa27bbe0aeacf7c1a6b57c8c)
1*e6d6c189SCody Peter Mello# From james@ruari-quinn.demon.co.uk  Thu Jun  5 11:43:58 2003
2*e6d6c189SCody Peter Mello# Return-Path: <james@ruari-quinn.demon.co.uk>
3*e6d6c189SCody Peter Mello# Received: from localhost (skeeve [127.0.0.1])
4*e6d6c189SCody Peter Mello# 	by skeeve.com (8.12.5/8.12.5) with ESMTP id h558eVui012655
5*e6d6c189SCody Peter Mello# 	for <arnold@localhost>; Thu, 5 Jun 2003 11:43:58 +0300
6*e6d6c189SCody Peter Mello# Received: from actcom.co.il [192.114.47.1]
7*e6d6c189SCody Peter Mello# 	by localhost with POP3 (fetchmail-5.9.0)
8*e6d6c189SCody Peter Mello# 	for arnold@localhost (single-drop); Thu, 05 Jun 2003 11:43:58 +0300 (IDT)
9*e6d6c189SCody Peter Mello# Received: by actcom.co.il (mbox arobbins)
10*e6d6c189SCody Peter Mello#  (with Cubic Circle's cucipop (v1.31 1998/05/13) Thu Jun  5 11:43:29 2003)
11*e6d6c189SCody Peter Mello# X-From_: james@ruari-quinn.demon.co.uk Wed Jun  4 20:09:54 2003
12*e6d6c189SCody Peter Mello# Received: from smtp1.actcom.net.il by actcom.co.il  with ESMTP
13*e6d6c189SCody Peter Mello# 	(8.11.6/actcom-0.2) id h54H9oY05088 for <arobbins@actcom.co.il>;
14*e6d6c189SCody Peter Mello# 	Wed, 4 Jun 2003 20:09:52 +0300 (EET DST)
15*e6d6c189SCody Peter Mello# 	(rfc931-sender: smtp.actcom.co.il [192.114.47.13])
16*e6d6c189SCody Peter Mello# Received: from f7.net (consort.superb.net [209.61.216.22])
17*e6d6c189SCody Peter Mello# 	by smtp1.actcom.net.il (8.12.8/8.12.8) with ESMTP id h54HB8To002721
18*e6d6c189SCody Peter Mello# 	for <arobbins@actcom.co.il>; Wed, 4 Jun 2003 20:11:09 +0300
19*e6d6c189SCody Peter Mello# Received: from fencepost.gnu.org (fencepost.gnu.org [199.232.76.164])
20*e6d6c189SCody Peter Mello# 	by f7.net (8.11.7/8.11.6) with ESMTP id h54H9li15411
21*e6d6c189SCody Peter Mello# 	for <arnold@skeeve.com>; Wed, 4 Jun 2003 13:09:47 -0400
22*e6d6c189SCody Peter Mello# Received: from monty-python.gnu.org ([199.232.76.173])
23*e6d6c189SCody Peter Mello# 	by fencepost.gnu.org with esmtp (Exim 4.20)
24*e6d6c189SCody Peter Mello# 	id 19Nbli-0001kD-BL
25*e6d6c189SCody Peter Mello# 	for bug-gawk@gnu.org; Wed, 04 Jun 2003 13:09:46 -0400
26*e6d6c189SCody Peter Mello# Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.20)
27*e6d6c189SCody Peter Mello# 	id 19NbZ5-0004V2-71
28*e6d6c189SCody Peter Mello# 	for bug-gawk@gnu.org; Wed, 04 Jun 2003 12:56:43 -0400
29*e6d6c189SCody Peter Mello# Received: from cicero.e-mis.co.uk ([212.240.194.162])
30*e6d6c189SCody Peter Mello# 	by monty-python.gnu.org with esmtp (Exim 4.20)
31*e6d6c189SCody Peter Mello# 	id 19NbYK-0003c7-AP
32*e6d6c189SCody Peter Mello# 	for bug-gawk@gnu.org; Wed, 04 Jun 2003 12:55:56 -0400
33*e6d6c189SCody Peter Mello# Received: from [10.139.58.254] (helo=tacitus)
34*e6d6c189SCody Peter Mello# 	by cicero.e-mis.co.uk with esmtp (Exim 3.35 #1 (Debian))
35*e6d6c189SCody Peter Mello# 	id 19NbWO-0007Qv-00
36*e6d6c189SCody Peter Mello# 	for <bug-gawk@gnu.org>; Wed, 04 Jun 2003 17:53:56 +0100
37*e6d6c189SCody Peter Mello# Received: from james by tacitus with local (Exim 3.36 #1 (Debian))
38*e6d6c189SCody Peter Mello# 	id 19NbWO-0000cK-00
39*e6d6c189SCody Peter Mello# 	for <bug-gawk@gnu.org>; Wed, 04 Jun 2003 17:53:56 +0100
40*e6d6c189SCody Peter Mello# To: bug-gawk@gnu.org
41*e6d6c189SCody Peter Mello# Subject: 3.1.0 regression
42*e6d6c189SCody Peter Mello# Mail-Copies-To: never
43*e6d6c189SCody Peter Mello# From: James Troup <james@nocrew.org>
44*e6d6c189SCody Peter Mello# User-Agent: Gnus/5.090017 (Oort Gnus v0.17) Emacs/20.7 (gnu/linux)
45*e6d6c189SCody Peter Mello# Date: Wed, 04 Jun 2003 17:53:56 +0100
46*e6d6c189SCody Peter Mello# Message-ID: <874r35wzq3.fsf@nocrew.org>
47*e6d6c189SCody Peter Mello# MIME-Version: 1.0
48*e6d6c189SCody Peter Mello# Content-Type: text/plain; charset=us-ascii
49*e6d6c189SCody Peter Mello# Sender: James Troup <james@ruari-quinn.demon.co.uk>
50*e6d6c189SCody Peter Mello# X-Spam-Status: No, hits=-3.9 required=5.0
51*e6d6c189SCody Peter Mello# 	tests=EMAIL_ATTRIBUTION,SIGNATURE_SHORT_DENSE,SPAM_PHRASE_00_01,
52*e6d6c189SCody Peter Mello# 	      USER_AGENT
53*e6d6c189SCody Peter Mello# 	version=2.41
54*e6d6c189SCody Peter Mello# X-Spam-Level:
55*e6d6c189SCody Peter Mello# X-SpamBouncer: 1.4 (10/07/01)
56*e6d6c189SCody Peter Mello# X-SBClass: OK
57*e6d6c189SCody Peter Mello# Status: R
58*e6d6c189SCody Peter Mello#
59*e6d6c189SCody Peter Mello# Hi Aharon,
60*e6d6c189SCody Peter Mello#
61*e6d6c189SCody Peter Mello# This bug report comes from the Debian bug tracking system.  You can
62*e6d6c189SCody Peter Mello# view the full log at:
63*e6d6c189SCody Peter Mello#
64*e6d6c189SCody Peter Mello#  http://bugs.debian.org/188345
65*e6d6c189SCody Peter Mello#
66*e6d6c189SCody Peter Mello# Like my other bug, this is a regression from 3.1.0 and I've reproduced
67*e6d6c189SCody Peter Mello# this problem with 3.1.2d.
68*e6d6c189SCody Peter Mello#
69*e6d6c189SCody Peter Mello# "Nikita V. Youshchenko" <yoush@cs.msu.su> writes:
70*e6d6c189SCody Peter Mello#
71*e6d6c189SCody Peter Mello# | Package: gawk
72*e6d6c189SCody Peter Mello# | Version: 1:3.1.2-2
73*e6d6c189SCody Peter Mello# | Severity: normal
74*e6d6c189SCody Peter Mello# | Tags: sid
75*e6d6c189SCody Peter Mello# |
76*e6d6c189SCody Peter Mello# | After upgrading gawk from woody to sid, I found one of my scripts not
77*e6d6c189SCody Peter Mello# | working. I explored this a little and found minimal script to reproduce
78*e6d6c189SCody Peter Mello# | the problem.
79*e6d6c189SCody Peter Mello# |
80*e6d6c189SCody Peter Mello# | File bug.awk is the following:
81*e6d6c189SCody Peter Mello# |
82*e6d6c189SCody Peter MelloBEGIN  {
83*e6d6c189SCody Peter Mello  WI_total = 0
84*e6d6c189SCody Peter Mello}
85*e6d6c189SCody Peter Mello{
86*e6d6c189SCody Peter Mello  WI_total++
87*e6d6c189SCody Peter Mello  {
88*e6d6c189SCody Peter Mello    split (  $1, sws, "_" )
89*e6d6c189SCody Peter Mello    a = sws[1]
90*e6d6c189SCody Peter Mello  }
91*e6d6c189SCody Peter Mello  print(sws[1])
92*e6d6c189SCody Peter Mello  print(a)
93*e6d6c189SCody Peter Mello}
94*e6d6c189SCody Peter Mello# |
95*e6d6c189SCody Peter Mello# | The second print should output the same what first print poutputs, but
96*e6d6c189SCody Peter Mello# | with gawk 3.1.2-2 it outputs nothing:
97*e6d6c189SCody Peter Mello# | > echo a_b | gawk -f bug.awk
98*e6d6c189SCody Peter Mello# | a
99*e6d6c189SCody Peter Mello# |
100*e6d6c189SCody Peter Mello# | >
101*e6d6c189SCody Peter Mello# |
102*e6d6c189SCody Peter Mello# | With gawk from stable I get what expexted:
103*e6d6c189SCody Peter Mello# | > echo a_b | gawk -f bug.awk
104*e6d6c189SCody Peter Mello# | a
105*e6d6c189SCody Peter Mello# | a
106*e6d6c189SCody Peter Mello# | >
107*e6d6c189SCody Peter Mello# |
108*e6d6c189SCody Peter Mello# | If I remove "WI_total++" line, bug disapperas
109*e6d6c189SCody Peter Mello# |
110*e6d6c189SCody Peter Mello# | -- System Information:
111*e6d6c189SCody Peter Mello# | Debian Release: 3.0
112*e6d6c189SCody Peter Mello# | Architecture: i386
113*e6d6c189SCody Peter Mello# | Kernel: Linux zigzag 2.4.19 16:49:13 MSK 2003 i686
114*e6d6c189SCody Peter Mello# | Locale: LANG=ru_RU.KOI8-R, LC_CTYPE=ru_RU.KOI8-R
115*e6d6c189SCody Peter Mello# |
116*e6d6c189SCody Peter Mello# | Versions of packages gawk depends on:
117*e6d6c189SCody Peter Mello# | ii  libc6                         2.3.1-16   GNU C Library: Shared libraries an
118*e6d6c189SCody Peter Mello# |
119*e6d6c189SCody Peter Mello# | -- no debconf information
120*e6d6c189SCody Peter Mello#
121*e6d6c189SCody Peter Mello# --
122*e6d6c189SCody Peter Mello# James
123*e6d6c189SCody Peter Mello#
124