diff --git a/src/main.rs b/src/main.rs index 97c424c..7a7c994 100644 --- a/src/main.rs +++ b/src/main.rs @@ -55,7 +55,13 @@ fn run() -> LogtimesResult { loop { // read 1 char - input.read_exact(&mut buf)?; + if let Err(e) = input.read_exact(&mut buf) { + if e.kind() == ErrorKind::UnexpectedEof { + return Ok(()); + } else { + return Err(e); + } + } // push that char to the "current line" buffer linebuf.push(buf[0]);