]> git.draconx.ca Git - dxcommon.git/commitdiff
gen-options.awk: Fix generated help text under mawk.
authorNick Bowler <nbowler@draconx.ca>
Sun, 8 Jan 2023 04:14:56 +0000 (23:14 -0500)
committerNick Bowler <nbowler@draconx.ca>
Sun, 8 Jan 2023 05:01:02 +0000 (00:01 -0500)
It appears that the following construction is not portable:

  % gawk 'BEGIN { a[0] = 0 in a ? 54 : 42; print a[0]; }'
  42

  % mawk 'BEGIN { a[0] = 0 in a ? 54 : 42; print a[0]; }'
  54

In gen-options.awk, this results in results in bogus leading newlines
added to the help text.  It is easy enough to restructure the code
to not do that, separating the test from the assignment.


No differences found