mirror of
https://github.com/uutils/coreutils
synced 2024-11-15 17:28:03 +00:00
Fix failure to print stdout for echo.
Upon program termination, pending stdout writes were not automatically flushed. When newlines are disabled, I force a flush to stdout.
This commit is contained in:
parent
98a86e60c8
commit
07d57ac109
1 changed files with 4 additions and 1 deletions
|
@ -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<String>) -> i32 {
|
|||
}
|
||||
}
|
||||
|
||||
if !options.newline {
|
||||
if options.newline {
|
||||
let _ = stdout().flush();
|
||||
} else {
|
||||
println!("")
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue