1
0
mirror of https://github.com/golang/go synced 2024-11-25 07:07:57 -07:00

Fix incorrect reporting of error in Scanner.next() when Read reads > 0 bytes but returns os.EOF.

R=golang-dev, gri1, gri
CC=golang-dev
https://golang.org/cl/2083042
This commit is contained in:
Kyle Consalus 2010-09-01 15:15:37 -07:00 committed by Robert Griesemer
parent 3d76135ee5
commit f8a67d79d1

View File

@ -236,10 +236,12 @@ func (s *Scanner) next() int {
if s.srcEnd == 0 {
return EOF
}
if err != os.EOF {
s.error(err.String())
break
}
}
}
// at least one byte
ch = int(s.srcBuf[s.srcPos])
if ch >= utf8.RuneSelf {