mirror of
https://github.com/uutils/coreutils.git
synced 2026-06-10 15:48:22 -07:00
mv: ensure line prints (#1890)
Previously this used `print` instead of `println`, and as a result the prompt would never appear and the command would hang. The Rust docs note this about print: > Note that stdout is frequently line-buffered by default so it may be > necessary to use io::stdout().flush() to ensure the output is emitted > immediately. Changing to `println` fixes the issue. Fixes #1889. Co-authored-by: Kevin Burke <kevin@burke.dev>
This commit is contained in:
co-authored by
Kevin Burke
parent
b54f0b1ff2
commit
4873c8a24b
+1
-1
@@ -380,7 +380,7 @@ fn rename(from: &PathBuf, to: &PathBuf, b: &Behavior) -> io::Result<()> {
|
||||
match b.overwrite {
|
||||
OverwriteMode::NoClobber => return Ok(()),
|
||||
OverwriteMode::Interactive => {
|
||||
print!("{}: overwrite ‘{}’? ", executable!(), to.display());
|
||||
println!("{}: overwrite ‘{}’? ", executable!(), to.display());
|
||||
if !read_yes() {
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user