From 054a1bf15b62cc73c5434ab15179a2e37c98dc4d Mon Sep 17 00:00:00 2001 From: Les De Ridder Date: Thu, 2 May 2019 02:47:00 +0200 Subject: [PATCH] Strip whitespace from right of process output --- ircbot.d | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/ircbot.d b/ircbot.d index 0ddd17e..9ef1ad3 100755 --- a/ircbot.d +++ b/ircbot.d @@ -67,7 +67,7 @@ void main() auto stdoutFD = pollfd(pipes.stdout.fileno, POLLIN); while (poll(&stdoutFD, 1, 0) > 0 && !pipes.stdout.eof) { - auto line = pipes.stdout.readln; + auto line = pipes.stdout.readln.stripRight; if (line.length > 0) { foreach (channel; Channels) @@ -79,7 +79,7 @@ void main() pollfd stderrFD = { pipes.stderr.fileno, POLLIN }; while (poll(&stderrFD, 1, 0) > 0 && !pipes.stderr.eof) { - auto line = pipes.stderr.readln; + auto line = pipes.stderr.readln.stripRight; if (line.length > 0) { foreach (channel; Channels) @@ -119,7 +119,6 @@ void main() ircClient.write(Message(null, "PONG", message.parameters)); break; case "376": - writeln("376 376 376"); ircClient.join(Channels); break; case "PRIVMSG":