Merge branch 'linecount_fix'
This commit is contained in:
commit
fd41ddefb0
1 changed files with 1 additions and 1 deletions
|
@ -50,7 +50,7 @@ func countLines(r io.Reader) (int, error) {
|
||||||
switch {
|
switch {
|
||||||
case err == io.EOF:
|
case err == io.EOF:
|
||||||
/* handle last line not having a newline at the end */
|
/* handle last line not having a newline at the end */
|
||||||
if bufLen >= 1 && buf[bufLen-1] != '\n' {
|
if bufLen >= 1 && buf[(bufLen-1)%(32*1024)] != '\n' {
|
||||||
count++
|
count++
|
||||||
}
|
}
|
||||||
return count, nil
|
return count, nil
|
||||||
|
|
Loading…
Reference in a new issue