Closed arnoldrobbins closed 1 year ago
Hi. The program below incorrectly sets RSTART in the second call to match(). This is a slightly modified version of a program submitted for a similar bug in gawk.
RSTART
match()
BEGIN { str="\342\200\257" print length(str) match(str,/.+/) print RSTART, RLENGTH match(str,/$/) print RSTART, RLENGTH }
When I run it, I get this:
$ ./a.out -f /tmp/morton.awk 1 1 1 -1 0
In the last line, the start value should be 2. FWIW, the gawk bug was that RSTART was 4; it was using byte counts instead of character counts.
[oof] thanks arnold!
found the bug, it came with the unicode changes.
Hi. The program below incorrectly sets
RSTART
in the second call tomatch()
. This is a slightly modified version of a program submitted for a similar bug in gawk.When I run it, I get this:
In the last line, the start value should be 2. FWIW, the gawk bug was that
RSTART
was 4; it was using byte counts instead of character counts.