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:
parent
3d76135ee5
commit
f8a67d79d1
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user