diff options
| author | Michael Stapelberg <stapelberg@debian.org> | 2014-06-19 09:22:53 +0200 |
|---|---|---|
| committer | Michael Stapelberg <stapelberg@debian.org> | 2014-06-19 09:22:53 +0200 |
| commit | 8a39ee361feb9bf46d728ff1ba4f07ca1d9610b1 (patch) | |
| tree | 4449f2036cccf162e8417cc5841a35815b3e7ac5 /src/pkg/text/scanner/scanner.go | |
| parent | c8bf49ef8a92e2337b69c14b9b88396efe498600 (diff) | |
| download | golang-8a39ee361feb9bf46d728ff1ba4f07ca1d9610b1.tar.gz | |
Imported Upstream version 1.3upstream/1.3
Diffstat (limited to 'src/pkg/text/scanner/scanner.go')
| -rw-r--r-- | src/pkg/text/scanner/scanner.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/pkg/text/scanner/scanner.go b/src/pkg/text/scanner/scanner.go index e0d86e343..db7ca73c6 100644 --- a/src/pkg/text/scanner/scanner.go +++ b/src/pkg/text/scanner/scanner.go @@ -240,6 +240,9 @@ func (s *Scanner) next() rune { s.srcEnd = i + n s.srcBuf[s.srcEnd] = utf8.RuneSelf // sentinel if err != nil { + if err != io.EOF { + s.error(err.Error()) + } if s.srcEnd == 0 { if s.lastCharLen > 0 { // previous character was not EOF @@ -248,9 +251,6 @@ func (s *Scanner) next() rune { s.lastCharLen = 0 return EOF } - if err != io.EOF { - s.error(err.Error()) - } // If err == EOF, we won't be getting more // bytes; break to avoid infinite loop. If // err is something else, we don't know if |
