NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: bin/53885 (awk ERE bug)



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