Miller produces no output on TSV with > 64K characters per line (#1505)

* Switch to bufio.Reader, first pass

* temp

* Simplify ILineReader by making it stateless

* Interface not necessary; ILineReader -> TLineReader

* neaten

* iterating
This commit is contained in:
John Kerl 2024-02-25 15:50:50 -05:00 committed by GitHub
parent 57b32c3e9b
commit 3ff43fa818
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 198 additions and 66 deletions

View file

@ -4,6 +4,7 @@ import (
"container/list"
"fmt"
"io"
"os"
"regexp"
"strings"
@ -149,8 +150,17 @@ func channelizedStanzaScanner(
stanzas := list.New()
stanza := newStanza()
for lineReader.Scan() {
line := lineReader.Text()
for {
line, err := lineReader.Read()
if err != nil {
if lib.IsEOF(err) {
done = true
break
} else {
fmt.Fprintf(os.Stderr, "mlr: %#v\n", err)
break
}
}
// Check for comments-in-data feature
// TODO: function-pointer this away