Subject: Awk 2.15.6 (follow up)
To: None <tech-userlevel@NetBSD.ORG>
From: Terry Moore <tmm@mcci.com>
List: tech-userlevel
Date: 07/03/1998 12:01:19
With respect to the change in awk's behavior I reported:
I've heard back from arnold at gnu.org, who confirmed that this was
intentional (but has not yet confirmed that this is a POSIX
compliance issue -- rather just that this is a change in a boundary
condition). Several people have suggested simple changes to
my scripts -- if I only had a few, I would do so, but it ain't
that easy at the moment.
Arnold also asked that I point out that gawk is now up to version
3.0.3, said that 2.15.6 is quite out of date, and suggested that
I update. Since it looks as if I will have to maintain a custom
version of gawk for a while, in order to support our scripts, I
will investigate doing that for our systems.
He also asked me to bring the version upgrade to the attention of
the NetBSD folk.
However, I investigated the difference, and found that changing
2.15.6 to emulate 2.15.5 in this respect is very simple --
move a line of code back to its old location. The patch is attached.
--- io.c Fri Oct 13 20:16:22 1995
+++ - Fri Jul 3 07:49:37 1998
@@ -188,14 +186,14 @@
cnt = get_a_record(&begin, iop, *RS, NULL);
if (cnt == EOF) {
cnt = 0;
retval = 1;
} else {
- NR += 1;
- FNR += 1;
- set_record(begin, cnt, 1);
+ NR += 1;
+ FNR += 1;
}
+ set_record(begin, cnt, 1);
return retval;
}