[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Bug Report (gawk)
From: |
Aharon Robbins |
Subject: |
Re: Bug Report (gawk) |
Date: |
Thu, 8 Aug 2002 03:51:53 +0300 |
Greetings. Re this:
> To: address@hidden
> Cc: address@hidden
> Subject: Bug Report (gawk)
> From: address@hidden (MURATA Yasuhisa)
>
> Hello, I report a bug.
>
> == PROGRAM (filename: atest.awk) ==
> BEGIN {
> RS=""
> }
>
> NR==1 {
> print 1
> RS="\n"
> next
> }
>
> NR==2 {
> print 2
> RS=""
> next
> }
>
> NR==3 {
> print 3
> RS="\n"
> next
> }
> ====
>
> == DATA (filename: atest.txt) ==
> 1111
>
> 2222
>
> ====
> note: last line is "\n".
>
>
> == RUN (gawk) ==
> > gawk -f atest.awk atest.txt
> 1
> 2
> (no stop!)
This is indeed a bug. Here is a patch.
Thanks,
Arnold
*** ../gawk-3.1.1/io.c Tue Apr 16 04:57:44 2002
--- io.c Wed Aug 7 13:38:49 2002
***************
*** 2345,2351 ****
* Leading newlines at the beginning of the file
* should be ignored. Whew!
*/
! if (RS_is_null && *start == '\n') {
/*
* have to catch the case of a
* single newline at the front of
--- 2561,2568 ----
* Leading newlines at the beginning of the file
* should be ignored. Whew!
*/
! if (RS_is_null && *start == '\n'
! && start < iop->end) {
/*
* have to catch the case of a
* single newline at the front of
- Bug Report (gawk), MURATA Yasuhisa, 2002/08/06
- Re: Bug Report (gawk),
Aharon Robbins <=