Error check was inverted.
Fixes #1396.
R=rsc, adg
CC=golang-dev
https://golang.org/cl/
3851042
// read operation. If write has happened since the last read, UnreadByte
// returns an error.
func (b *Buffer) UnreadByte() os.Error {
- if b.lastRead == opReadRune || b.lastRead == opRead {
+ if b.lastRead != opReadRune && b.lastRead != opRead {
return os.ErrorString("bytes.Buffer: UnreadByte: previous operation was not a read")
}
b.lastRead = opInvalid