From f7d6bd4cb3bba8d78bf4e995b0d6381881387c9d Mon Sep 17 00:00:00 2001 From: elkowar <5300871+elkowar@users.noreply.github.com> Date: Sat, 26 Dec 2020 13:11:15 +0100 Subject: [PATCH] Fix empty lines in command output when communicating with daemon\n\nfixes #76 --- src/client.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/client.rs b/src/client.rs index 06f8fe9..aefde59 100644 --- a/src/client.rs +++ b/src/client.rs @@ -30,6 +30,8 @@ pub fn forward_command_to_server(mut stream: UnixStream, action: opts::ActionWit let mut buf = String::new(); stream.set_read_timeout(Some(std::time::Duration::from_millis(100)))?; stream.read_to_string(&mut buf)?; - println!("{}", buf); + if !buf.is_empty() { + println!("{}", buf); + } Ok(()) }