freebsd-dev/contrib/one-true-awk/bugs-fixed
Warner Losh 23f24377b1 awk: Merge 20210729 from One True Awk upstream (0592de4a)
July 27, 2021:
	As per IEEE Std 1003.1-2008, -F "str" is now consistent with
	-v FS="str" when str is null. Thanks to Warner Losh.

July 24, 2021:
	Fix readrec's definition of a record. This fixes an issue
	with NetBSD's RS regular expression support that can cause
	an infinite read loop. Thanks to Miguel Pineiro Jr.

	Fix regular expression RS ^-anchoring. RS ^-anchoring needs to
	know if it is reading the first record of a file. This change
	restores a missing line that was overlooked when porting NetBSD's
	RS regex functionality. Thanks to Miguel Pineiro Jr.

	Fix size computation in replace_repeat() for special case
	REPEAT_WITH_Q. Thanks to Todd C. Miller.

Also, included the tests from upstream, though they aren't yet connected
to the tree.

Sponsored by:		Netflix
2021-08-01 10:22:39 -06:00
..
a-format.awk
a-format.bad
a-format.ok
concat-assign-same.awk
concat-assign-same.bad
concat-assign-same.ok
decr-NF.awk
decr-NF.bad
decr-NF.ok
fmt-overflow.awk
fmt-overflow.ok
fs-overflow.awk
fs-overflow.ok awk: Merge 20210729 from One True Awk upstream (0592de4a) 2021-08-01 10:22:39 -06:00
getline-numeric.awk
getline-numeric.bad
getline-numeric.in
getline-numeric.ok
inf-nan-torture.awk awk: Merge 20210729 from One True Awk upstream (0592de4a) 2021-08-01 10:22:39 -06:00
inf-nan-torture.in awk: Merge 20210729 from One True Awk upstream (0592de4a) 2021-08-01 10:22:39 -06:00
inf-nan-torture.ok awk: Merge 20210729 from One True Awk upstream (0592de4a) 2021-08-01 10:22:39 -06:00
missing-precision.awk
missing-precision.ok
negative-nf.awk
negative-nf.ok
nf-self-assign.awk
nf-self-assign.bad
nf-self-assign.ok
numeric-fs.awk
numeric-fs.ok
numeric-output-seps.awk
numeric-output-seps.bad
numeric-output-seps.ok
numeric-rs.awk
numeric-rs.bad
numeric-rs.ok
numeric-subsep.awk
numeric-subsep.bad
numeric-subsep.ok
ofs-rebuild.awk
ofs-rebuild.bad
ofs-rebuild.ok
pfile-overflow.awk awk: Merge 20210729 from One True Awk upstream (0592de4a) 2021-08-01 10:22:39 -06:00
pfile-overflow.ok awk: Merge 20210729 from One True Awk upstream (0592de4a) 2021-08-01 10:22:39 -06:00
README
REGRESS awk: Merge 20210729 from One True Awk upstream (0592de4a) 2021-08-01 10:22:39 -06:00
rs_underflow.awk awk: Merge 20210729 from One True Awk upstream (0592de4a) 2021-08-01 10:22:39 -06:00
rs_underflow.in awk: Merge 20210729 from One True Awk upstream (0592de4a) 2021-08-01 10:22:39 -06:00
rs_underflow.ok awk: Merge 20210729 from One True Awk upstream (0592de4a) 2021-08-01 10:22:39 -06:00
space.awk
space.bad
space.ok
split-fs-from-array.awk
split-fs-from-array.ok
string-conv.awk
string-conv.bad
string-conv.ok
subsep-overflow.awk
subsep-overflow.ok
system-status.awk
system-status.bad
system-status.ok
unary-plus.awk
unary-plus.bad
unary-plus.ok

List of bugs fixed.

1. ofs-rebuild: OFS value used to rebuild the record was incorrect.
Fixed August 19, 2014. Revised fix August 2018.

2. system-status: Instead of a floating-point division by 256, use
the wait(2) macros to create a reasonable exit status. Fixed March 12, 2016.

3. space: Use provided xisblank() function instead of ispace() for
matching [[:blank:]].

4. a-format: Add POSIX standard %a and %A to supported formats. Check
at runtime that this format is available.

5. decr-NF: Decrementing NF did not change $0. This is a decades-old
bug. There are interactions with the old and new value of OFS as well.
Most of the fix came from the NetBSD awk.

6. string-conv: String conversions of scalars were sticky.  Once a
conversion to string happened, even with OFMT, that value was used until
a new numeric value was assigned, even if OFMT differed from CONVFMT,
and also if CONVFMT changed.

7. unary-plus: Unary plus on a string constant returned the string.
Instead, it should convert the value to numeric and give that value.

8. concat-assign-same: Concatenation previously evaluated both sides of the
expression before doing its work, which, since assign() evaluates to the cell
being assigned to, meant that expressions like "print (a = 1) (a = 2)" would
print "22" rather than "12".

9. missing-precision: When using the format string "%*s", the precision
argument was used without checking if it was present first.

10. missing-precision: When using the format string "%*s", the precision
argument was used without checking if it was present first.

11. fmt-overflow: The buffer used for OFMT/CONVFMT conversions was written
to with sprintf(), which meant that some conversions could write past the
end.

12. numeric-subsep, numeric-fs, numeric-output-seps, numerics-rs: If SUBSEP,
FS, RS, OFS, or ORS were set to a numeric value, then their string values
wouldn't always be generated before being needed.

13. subsep-overflow: The length of SUBSEP needs to be rechecked after
calling execute(), in case SUBSEP itself has been changed.

14. split-fs-from-array: If the third argument to split() comes from the
array passed as the second argument, then split() would previously read
from the freed memory and possibly produce incorrect results (depending
on the system's malloc()/free() behaviour.)

15. getline-numeric: The `getline xx < file' syntax did not check if
values were numeric, in discordance from POSIX. Test case adapted from
one posted by Ben Bacarisse <ben.usenet@bsb.me.uk> in comp.lang.awk,
January 2019.