Browse Source

Fix io.Reader ambiguity on EOF in progressreader

Docker-DCO-1.1-Signed-off-by: Tibor Vass <teabee89@gmail.com> (github: tiborvass)
Tibor Vass 11 years ago
parent
commit
caa5769928
1 changed files with 1 additions and 1 deletions
  1. 1 1
      utils/progressreader.go

+ 1 - 1
utils/progressreader.go

@@ -32,7 +32,7 @@ func (r *progressReader) Read(p []byte) (n int, err error) {
 		r.lastUpdate = r.progress.Current
 		r.lastUpdate = r.progress.Current
 	}
 	}
 	// Send newline when complete
 	// Send newline when complete
-	if r.newLine && err != nil {
+	if r.newLine && err != nil && read == 0 {
 		r.output.Write(r.sf.FormatStatus("", ""))
 		r.output.Write(r.sf.FormatStatus("", ""))
 	}
 	}
 	return read, err
 	return read, err