NetBSD-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: bin/53885 (awk ERE bug)
The following reply was made to PR bin/53885; it has been noted by GNATS.
From: Martijn Dekker <martijn%inlv.org@localhost>
To: gnats-bugs%NetBSD.org@localhost, gnats-admin%netbsd.org@localhost, netbsd-bugs%netbsd.org@localhost,
jdolecek%NetBSD.org@localhost, kre%munnari.OZ.AU@localhost
Cc:
Subject: Re: bin/53885 (awk ERE bug)
Date: Fri, 18 Jan 2019 21:31:37 +0100
Op 18-01-19 om 17:18 schreef Martijn Dekker:
> If it is true that nawk's ERE implementation is so "exceedingly
> complicated and fragile" that adding a basic and standard ERE feature
> would be too difficult, then this awk is broken by design and you should
> consider using some other awk implementation as the default awk.
It must not actually be true, though -- because Apple's /usr/bin/awk is
of the same lineage, and it supports POSIX EREs just fine, including the
bounds/interval expressions. See the code at:
https://opensource.apple.com/source/awk/awk-24/src/b.c.auto.html
...and if you get the tarball at
https://opensource.apple.com/tarballs/awk/awk-24.tar.gz
(and ignore the obsolete Makefile within it) then you get another
awk.tar.gz within that with the original sources (warning: files at top
level, so 'mkdir' and 'cd' first), and a src/ directory with Apple's
patched version. The code for the bounds feature is quite easy to find
in a 'diff -ur' between them.
So this should be quite possible to backport... I hope someone will. If
not, maybe I'll take a shot at it when I find significant time, because
I think it's important for POSIX awk scripts to be actually portable.
- M.
Home |
Main Index |
Thread Index |
Old Index