summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMateusz Czapliński <czapkofan@gmail.com>2018-10-21 01:11:26 +0200
committerMateusz Czapliński <czapkofan@gmail.com>2018-10-21 01:11:26 +0200
commit27ad66c827203e46113b5eb9597f923992273d12 (patch)
treefef47d7ee7928dc69bbf6393b1abd5ca235d93ea
parent38fd19f32434b82efeac3c3e6203edc13ba6eac9 (diff)
fix behavior of Ctrl-S & Ctrl-Q
-rw-r--r--up.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/up.go b/up.go
index 0c264d6..4200ad1 100644
--- a/up.go
+++ b/up.go
@@ -540,7 +540,7 @@ func (b *Buf) NewReader(blocking bool) io.Reader {
return funcReader(func(p []byte) (n int, err error) {
b.mu.Lock()
end := b.n
- for blocking && end == i && b.status != bufEOF && end < len(b.bytes) {
+ for blocking && end == i && b.status == bufReading && end < len(b.bytes) {
// TODO: don't return EOF if input is fully buffered? difficult choice :/
// FIXME: somehow let GC collect this goroutine if its caller is killed & GCed
// TODO: track leaking of these goroutines, see rsc's last hint in https://golang.org/issue/24696