On Sep 6, 2007, at 2:19 PM, Ralf Wildenhues wrote:
Hi Gary,
Hallo Ralf,
Gary V. Vaughan <gary <at> gnu.org> writes:Work around a bug in darwin's awk:(func_get_translations): The first awk script mangles the last entry passed to it for at least the awk implementation shipped with Darwin 8.10.1. Capture $3 into a variable too to work- around that problem.Could you be bothered to explain what this bug does? I don't quite understand from the patch nor the description. Should it be listed in the Autoconf shell portability section?
Sure.
$ cat in
cs:1.4o:../PO-files
da:1.4o:../PO-files
de:1.4o:../PO-files
el:1.4n:../PO-files
el:1.4o:../PO-files
fr:1.4o:../PO-files
# Before the patch (note the last line of output):
$ cat in | /opt/local/bin/gawk -F: '
> { if (lang && $1 != lang) print lang, ver, $3 }
> { lang = $1; ver = $2 }
> END { if (lang) print lang, ver, $3 }'
cs 1.4o ../PO-files
da 1.4o ../PO-files
de 1.4o ../PO-files
el 1.4o ../PO-files
fr 1.4o ../PO-files
$ cat in | /usr/bin/awk -F: '
> { if (lang && $1 != lang) print lang, ver, $3 }
> { lang = $1; ver = $2 }
> END { if (lang) print lang, ver, $3 }'
cs 1.4o ../PO-files
da 1.4o ../PO-files
de 1.4o ../PO-files
el 1.4o ../PO-files
fr 1.4o
# After the patch:
$ cat in | /opt/local/bin/gawk -F: '
> { if (lang && $1 != lang) print lang, ver, subdir }
> { lang = $1; ver = $2; subdir = $3 }
> END { if (lang) print lang, ver, subdir }'
cs 1.4o ../PO-files
da 1.4o ../PO-files
de 1.4o ../PO-files
el 1.4o ../PO-files
fr 1.4o ../PO-files
$ cat in | /usr/bin/awk -F: '
> { if (lang && $1 != lang) print lang, ver, subdir }
> { lang = $1; ver = $2; subdir = $3 }
> END { if (lang) print lang, ver, subdir }'
cs 1.4o ../PO-files
da 1.4o ../PO-files
de 1.4o ../PO-files
el 1.4o ../PO-files
fr 1.4o ../PO-files
It appears that only gawk saves $3 from the last input line for use
in the END clause, where darwin awk (maybe others too, I haven't
looked elsewhere) discards it.
Cheers,
Gary
--
())_. Email me: [EMAIL PROTECTED]
( '/ Read my blog: http://blog.azazil.net
/ )= ...and my book: http://sources.redhat.com/autobook
`(_~)_ Join my AGLOCO Network: http://www.agloco.com/r/BBBS7912
PGP.sig
Description: This is a digitally signed message part
_______________________________________________ M4-patches mailing list [email protected] http://lists.gnu.org/mailman/listinfo/m4-patches
