Read one line for empty strings

This commit is contained in:
Zachary Yedidia
2017-03-26 15:27:53 -04:00
parent 15055440da
commit b23c507af5

View File

@@ -70,6 +70,10 @@ func NewLineArray(reader io.Reader) *LineArray {
var buf bytes.Buffer
tee := io.TeeReader(reader, &buf)
numlines, _ := lineCounter(tee)
if numlines == 0 {
numlines = 1
}
la.lines = make([]Line, numlines)
br := bufio.NewReader(&buf)