A few I/O related fixes

This commit is contained in:
jD91mZM2
2018-09-23 17:28:42 +02:00
parent 1e9dbfdf62
commit 658dc34d30
4 changed files with 28 additions and 7 deletions
+5 -1
View File
@@ -70,7 +70,11 @@ impl RawLineBuffer {
self.read += read_usize;
if read == 0 {
return Line::EOF;
return if self.buf.is_empty() {
Line::EOF
} else {
Line::Some(&self.buf)
};
}
if read < 0 {
return Line::Error;