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
1 changed files with 4 additions and 1 deletions

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);