Skip to content

v1.30.0: -N crlf mode, leftmost-longest regexes

Choose a tag to compare

@benhoyt benhoyt released this 02 Nov 16:15
· 19 commits to master since this release

This release adds one small new feature and fixes a subtle but long-standing bug:

  • The new feature is the -N mode command-line option (and corresponding interp.Config field NewlineOutput) to control newline translation on output. Currently the default is "smart", meaning no translation (-N raw) on Unix/Linux and translate LF to CR LF (-N crlf) on Windows, but you can override the OS-based default with the -N option. Thanks @hymkor for the contribution.
  • The bug fix is that previously GoAWK used the Go default of "leftmost-first matching", whereas other AWKs use "leftmost-longest matching". So switch to that using the Regexp.Longest method.

This release also includes a small performance improvement to the postincr/postdecr bytecode by @triallax in #253.

Full Changelog: v1.29.1...v1.30.0