xref: /aosp_15_r20/external/one-true-awk/bugs-fixed/README (revision 9a7741de182b2776d7b30d6355f2585c0780a51b)
1*9a7741deSElliott HughesList of bugs fixed.
2*9a7741deSElliott Hughes
3*9a7741deSElliott Hughes1. ofs-rebuild: OFS value used to rebuild the record was incorrect.
4*9a7741deSElliott HughesFixed August 19, 2014. Revised fix August 2018.
5*9a7741deSElliott Hughes
6*9a7741deSElliott Hughes2. system-status: Instead of a floating-point division by 256, use
7*9a7741deSElliott Hughesthe wait(2) macros to create a reasonable exit status. Fixed March 12, 2016.
8*9a7741deSElliott Hughes
9*9a7741deSElliott Hughes3. space: Use provided xisblank() function instead of ispace() for
10*9a7741deSElliott Hughesmatching [[:blank:]].
11*9a7741deSElliott Hughes
12*9a7741deSElliott Hughes4. a-format: Add POSIX standard %a and %A to supported formats. Check
13*9a7741deSElliott Hughesat runtime that this format is available.
14*9a7741deSElliott Hughes
15*9a7741deSElliott Hughes5. decr-NF: Decrementing NF did not change $0. This is a decades-old
16*9a7741deSElliott Hughesbug. There are interactions with the old and new value of OFS as well.
17*9a7741deSElliott HughesMost of the fix came from the NetBSD awk.
18*9a7741deSElliott Hughes
19*9a7741deSElliott Hughes6. string-conv: String conversions of scalars were sticky.  Once a
20*9a7741deSElliott Hughesconversion to string happened, even with OFMT, that value was used until
21*9a7741deSElliott Hughesa new numeric value was assigned, even if OFMT differed from CONVFMT,
22*9a7741deSElliott Hughesand also if CONVFMT changed.
23*9a7741deSElliott Hughes
24*9a7741deSElliott Hughes7. unary-plus: Unary plus on a string constant returned the string.
25*9a7741deSElliott HughesInstead, it should convert the value to numeric and give that value.
26*9a7741deSElliott Hughes
27*9a7741deSElliott Hughes8. concat-assign-same: Concatenation previously evaluated both sides of the
28*9a7741deSElliott Hughesexpression before doing its work, which, since assign() evaluates to the cell
29*9a7741deSElliott Hughesbeing assigned to, meant that expressions like "print (a = 1) (a = 2)" would
30*9a7741deSElliott Hughesprint "22" rather than "12".
31*9a7741deSElliott Hughes
32*9a7741deSElliott Hughes9. missing-precision: When using the format string "%*s", the precision
33*9a7741deSElliott Hughesargument was used without checking if it was present first.
34*9a7741deSElliott Hughes
35*9a7741deSElliott Hughes10. missing-precision: When using the format string "%*s", the precision
36*9a7741deSElliott Hughesargument was used without checking if it was present first.
37*9a7741deSElliott Hughes
38*9a7741deSElliott Hughes11. fmt-overflow: The buffer used for OFMT/CONVFMT conversions was written
39*9a7741deSElliott Hughesto with sprintf(), which meant that some conversions could write past the
40*9a7741deSElliott Hughesend.
41*9a7741deSElliott Hughes
42*9a7741deSElliott Hughes12. numeric-subsep, numeric-fs, numeric-output-seps, numerics-rs: If SUBSEP,
43*9a7741deSElliott HughesFS, RS, OFS, or ORS were set to a numeric value, then their string values
44*9a7741deSElliott Hugheswouldn't always be generated before being needed.
45*9a7741deSElliott Hughes
46*9a7741deSElliott Hughes13. subsep-overflow: The length of SUBSEP needs to be rechecked after
47*9a7741deSElliott Hughescalling execute(), in case SUBSEP itself has been changed.
48*9a7741deSElliott Hughes
49*9a7741deSElliott Hughes14. split-fs-from-array: If the third argument to split() comes from the
50*9a7741deSElliott Hughesarray passed as the second argument, then split() would previously read
51*9a7741deSElliott Hughesfrom the freed memory and possibly produce incorrect results (depending
52*9a7741deSElliott Hugheson the system's malloc()/free() behaviour.)
53*9a7741deSElliott Hughes
54*9a7741deSElliott Hughes15. getline-numeric: The `getline xx < file' syntax did not check if
55*9a7741deSElliott Hughesvalues were numeric, in discordance from POSIX. Test case adapted from
56*9a7741deSElliott Hughesone posted by Ben Bacarisse <[email protected]> in comp.lang.awk,
57*9a7741deSElliott HughesJanuary 2019.
58