From b4752e079f773a4a129f0144e0d194d3f93c2112 Mon Sep 17 00:00:00 2001 From: muskuloes Date: Mon, 20 Apr 2020 22:21:57 +0200 Subject: [PATCH] flush output of unexpand command as well --- src/uu/expand/src/expand.rs | 2 +- src/uu/unexpand/src/unexpand.rs | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/uu/expand/src/expand.rs b/src/uu/expand/src/expand.rs index 74a549687..49e189115 100644 --- a/src/uu/expand/src/expand.rs +++ b/src/uu/expand/src/expand.rs @@ -244,10 +244,10 @@ fn expand(options: Options) { } } - safe_unwrap!(output.flush()); byte += nbytes; // advance the pointer } + safe_unwrap!(output.flush()); buf.truncate(0); // clear the buffer } } diff --git a/src/uu/unexpand/src/unexpand.rs b/src/uu/unexpand/src/unexpand.rs index 3c680f8c4..f224441e1 100644 --- a/src/uu/unexpand/src/unexpand.rs +++ b/src/uu/unexpand/src/unexpand.rs @@ -324,6 +324,7 @@ fn unexpand(options: Options) { // write out anything remaining write_tabs(&mut output, ts, scol, col, pctype == Tab, init, true); + safe_unwrap!(output.flush()); buf.truncate(0); // clear out the buffer } }