Bug 820550 - gawk: getline in BEGIN skips 2 lines
Summary: gawk: getline in BEGIN skips 2 lines
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: gawk
Version: 16
Hardware: x86_64
OS: Linux
unspecified
high
Target Milestone: ---
Assignee: Martin Bříza
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On: 808005
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-05-10 11:37 UTC by James Hogan
Modified: 2012-06-28 03:35 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-06-28 03:20:27 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description James Hogan 2012-05-10 11:37:19 UTC
Description of problem:

A getline in the BEGIN section seems to eat 2 lines instead of 1 from the point of view of the main section. This works correctly on Centos 6 (GNU Awk 3.1.7).

Version-Release number of selected component (if applicable):
GNU Awk 4.0.0

How reproducible:
always

Steps to Reproduce:
{ echo "line 1"; echo "line 2"; echo "line 3"; } | awk 'BEGIN { getline } { print $0 }'

  
Actual results (GNU Awk 4.0.0):
line 3

Expected results (GNU Awk 3.1.7):
line 2
line 3

Comment 1 James Hogan 2012-05-11 12:22:12 UTC
To quote Aharon Robbins on gawk-bugs list (http://lists.gnu.org/archive/html/bug-gawk/2012-05/msg00009.html):

Hi. Thanks for the bug report.

This bug is fixed in gawk 4.0.1, which I released a few weeks ago.
The correct option for Redhat is to simply upgrade to the new release.

Thanks again for taking the time to send in a report.

Arnold

Comment 2 Martin Bříza 2012-06-06 13:20:07 UTC
The component has changed its owner to me, so I'm assigning the bug to myself.

Comment 3 Fedora Update System 2012-06-07 12:06:25 UTC
gawk-4.0.1-1.fc17 has been submitted as an update for Fedora 17.
https://admin.fedoraproject.org/updates/gawk-4.0.1-1.fc17

Comment 4 Fedora Update System 2012-06-07 12:07:46 UTC
gawk-4.0.1-1.fc16 has been submitted as an update for Fedora 16.
https://admin.fedoraproject.org/updates/gawk-4.0.1-1.fc16

Comment 5 Fedora Update System 2012-06-07 22:55:49 UTC
Package gawk-4.0.1-1.fc16:
* should fix your issue,
* was pushed to the Fedora 16 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing gawk-4.0.1-1.fc16'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2012-9014/gawk-4.0.1-1.fc16
then log in and leave karma (feedback).

Comment 6 James Hogan 2012-06-08 09:12:59 UTC
Thanks, gawk-4.0.1-1.fc16.x86_64 fixes this issue for me.

Comment 7 Fedora Update System 2012-06-28 03:20:27 UTC
gawk-4.0.1-1.fc16 has been pushed to the Fedora 16 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 8 Fedora Update System 2012-06-28 03:35:01 UTC
gawk-4.0.1-1.fc17 has been pushed to the Fedora 17 stable repository.  If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.