mirror of https://github.com/pragma-/pbot.git
pbot-vm: Add newline to output only if output does not already have a newline
This commit is contained in:
parent
3375580a2d
commit
690c5f5c44
|
@ -116,7 +116,10 @@ sub process_command($command, $mod, $user, $tag) {
|
||||||
|
|
||||||
print STDERR "=" x 40, "\n";
|
print STDERR "=" x 40, "\n";
|
||||||
|
|
||||||
return "$result\n";
|
# ensure output is newline-terminated
|
||||||
|
$result .= "\n" unless $result =~ /\n$/;
|
||||||
|
|
||||||
|
return $result;
|
||||||
} else {
|
} else {
|
||||||
# wait for child to finish
|
# wait for child to finish
|
||||||
waitpid($pid, 0);
|
waitpid($pid, 0);
|
||||||
|
|
Loading…
Reference in New Issue