Strip whitespace from right of process output
This commit is contained in:
parent
849494b1a7
commit
054a1bf15b
5
ircbot.d
5
ircbot.d
|
@ -67,7 +67,7 @@ void main()
|
||||||
auto stdoutFD = pollfd(pipes.stdout.fileno, POLLIN);
|
auto stdoutFD = pollfd(pipes.stdout.fileno, POLLIN);
|
||||||
while (poll(&stdoutFD, 1, 0) > 0 && !pipes.stdout.eof)
|
while (poll(&stdoutFD, 1, 0) > 0 && !pipes.stdout.eof)
|
||||||
{
|
{
|
||||||
auto line = pipes.stdout.readln;
|
auto line = pipes.stdout.readln.stripRight;
|
||||||
if (line.length > 0)
|
if (line.length > 0)
|
||||||
{
|
{
|
||||||
foreach (channel; Channels)
|
foreach (channel; Channels)
|
||||||
|
@ -79,7 +79,7 @@ void main()
|
||||||
pollfd stderrFD = { pipes.stderr.fileno, POLLIN };
|
pollfd stderrFD = { pipes.stderr.fileno, POLLIN };
|
||||||
while (poll(&stderrFD, 1, 0) > 0 && !pipes.stderr.eof)
|
while (poll(&stderrFD, 1, 0) > 0 && !pipes.stderr.eof)
|
||||||
{
|
{
|
||||||
auto line = pipes.stderr.readln;
|
auto line = pipes.stderr.readln.stripRight;
|
||||||
if (line.length > 0)
|
if (line.length > 0)
|
||||||
{
|
{
|
||||||
foreach (channel; Channels)
|
foreach (channel; Channels)
|
||||||
|
@ -119,7 +119,6 @@ void main()
|
||||||
ircClient.write(Message(null, "PONG", message.parameters));
|
ircClient.write(Message(null, "PONG", message.parameters));
|
||||||
break;
|
break;
|
||||||
case "376":
|
case "376":
|
||||||
writeln("376 376 376");
|
|
||||||
ircClient.join(Channels);
|
ircClient.join(Channels);
|
||||||
break;
|
break;
|
||||||
case "PRIVMSG":
|
case "PRIVMSG":
|
||||||
|
|
Loading…
Reference in New Issue