diff --git a/src/yes/yes.rs b/src/yes/yes.rs index 49643c732..c79ea6340 100644 --- a/src/yes/yes.rs +++ b/src/yes/yes.rs @@ -22,6 +22,8 @@ use std::io::Write; static NAME: &'static str = "yes"; static VERSION: &'static str = env!("CARGO_PKG_VERSION"); +const BUF_SIZE: usize = 8192; + pub fn uumain(args: Vec) -> i32 { let mut opts = Options::new(); @@ -51,7 +53,13 @@ pub fn uumain(args: Vec) -> i32 { matches.free.join(" ") }; - exec(&string[..]); + let mut multistring = string.clone(); + while multistring.len() < BUF_SIZE - string.len() - 1 { + multistring.push_str("\n"); + multistring.push_str(&string); + } + + exec(&multistring[..]); 0 }