b7a4eda40af31dfb61d9fe02af0760d582b4797a
Port Hare's auto-grow newscanner (scanner.ha:72) and scan_rune (scanner.ha:259). scanner gains a maxread field (== cap for newscannerbuf, scanner.ha:101); readahead grows by BUFSZ up to maxread via alloc+copy (Hare appends; ww flat ptr/cap scanner, old block left to process-exit reclaim). scanbytes' overflow test gains the avail >= maxread leg (Hare's pending >= readahead predicate) so a growable scanner refills instead of overflowing. finish ports the free(scan.buffer) verbatim per the regex #27 precedent. Tests: rune scan over 1/2/3/4-byte UTF-8 + EOF, invalid initial/truncated/surrogate sequences, newscanner grow round-trip + scanrune-over-newscanner, maxread overflow.
Description
No description provided
Languages
C
89.4%
Python
7.2%
Makefile
2.3%
Shell
0.8%
Assembly
0.3%