diff --git a/src/echo/echo.rs b/src/echo/echo.rs index 3e8abdef2..1fe6b1608 100644 --- a/src/echo/echo.rs +++ b/src/echo/echo.rs @@ -12,6 +12,7 @@ extern crate getopts; extern crate libc; +use std::io::{stdout, Write}; use std::str::from_utf8; #[path = "../common/util.rs"] @@ -242,7 +243,9 @@ pub fn uumain(args: Vec) -> i32 { } } - if !options.newline { + if options.newline { + let _ = stdout().flush(); + } else { println!("") }