Skip to content

Commit 97f18da

Browse files
committed
Exit REPL loop on EOF from stdin
1 parent b5c3b17 commit 97f18da

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

crates/irust/src/bare_repl.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ pub fn run(mut irust: IRust) -> crate::irust::Result<()> {
1010

1111
loop {
1212
let n = stdin.read(&mut input_buf)?;
13+
if n == 0 {
14+
break Ok(());
15+
}
1316
input.push_str(&String::from_utf8_lossy(&input_buf[..n]));
1417

1518
let input_c = input.clone();

0 commit comments

Comments
 (0)