3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-12-23 03:02:47 +01:00

pbot-vm: Add newline to output only if output does not already have a newline

This commit is contained in:
Pragmatic Software 2022-04-07 18:21:54 -07:00
parent 3375580a2d
commit 690c5f5c44

View File

@ -116,7 +116,10 @@ sub process_command($command, $mod, $user, $tag) {
print STDERR "=" x 40, "\n";
return "$result\n";
# ensure output is newline-terminated
$result .= "\n" unless $result =~ /\n$/;
return $result;
} else {
# wait for child to finish
waitpid($pid, 0);