From 690c5f5c44e721938ff27a4f7b7068475809efaa Mon Sep 17 00:00:00 2001 From: Pragmatic Software Date: Thu, 7 Apr 2022 18:21:54 -0700 Subject: [PATCH] pbot-vm: Add newline to output only if output does not already have a newline --- applets/pbot-vm/guest/lib/Guest.pm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/applets/pbot-vm/guest/lib/Guest.pm b/applets/pbot-vm/guest/lib/Guest.pm index 914a4504..58fd45b7 100644 --- a/applets/pbot-vm/guest/lib/Guest.pm +++ b/applets/pbot-vm/guest/lib/Guest.pm @@ -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);