1
0
mirror of https://github.com/golang/go synced 2024-11-19 08:14:40 -07:00

io: fix SectionReader Seek to seek backwards

Fixes #899.

R=golang-dev, rminnich, adg
CC=golang-dev
https://golang.org/cl/1749041
This commit is contained in:
Peter Mundy 2010-07-08 16:57:07 +10:00 committed by Andrew Gerrand
parent bf5b05f2d4
commit 56b3e5d644

View File

@ -336,7 +336,7 @@ func (s *SectionReader) Seek(offset int64, whence int) (ret int64, err os.Error)
case 2: case 2:
offset += s.limit offset += s.limit
} }
if offset < s.off || offset > s.limit { if offset < s.base || offset > s.limit {
return 0, os.EINVAL return 0, os.EINVAL
} }
s.off = offset s.off = offset