onetrueawk / awk

One true awk
Other
1.96k stars 156 forks source link

Store the Cell containing ARGV instead of the ARGV table itself. #230

Closed millert closed 2 months ago

millert commented 2 months ago

The underlying table (array) may change due to, for example, "delete ARGV". However, the Cell that stores ARGV should not change. Also remove the ENVtab global which is never used outside of envinit(). Fixes issue #229.

arnoldrobbins commented 2 months ago

@millert Can you please add a regression test to the test suite? Thanks!

millert commented 2 months ago

@arnoldrobbins I added a test to testdir/T.argv that crashes on Linux (or OpenBSD) without the fix.

plan9 commented 2 months ago

thanks todd.

arnoldrobbins commented 2 months ago

And I will also echo thanks here. :-)