mirror of
https://github.com/pragma-/pbot.git
synced 2024-11-22 11:59:43 +01:00
pbot-vm: fix potential time-out when outputting 0
If the output from a code snippet is `0` without a newline, Perl treats this as a false value. When Guest::process_command() returns a false value, that signals to guest-server::serial_server() that it is the parent returning and so it will not send the result back to the host. However, `0\n` is a true value. Solution: always append a final newline to the guest output.
This commit is contained in:
parent
a98a0fa0fb
commit
03fb901291
@ -116,7 +116,7 @@ sub process_command($command, $mod, $user, $tag) {
|
||||
|
||||
print STDERR "=" x 40, "\n";
|
||||
|
||||
return $result;
|
||||
return "$result\n";
|
||||
} else {
|
||||
# wait for child to finish
|
||||
waitpid($pid, 0);
|
||||
|
@ -25,8 +25,8 @@ use PBot::Imports;
|
||||
# These are set by the /misc/update_version script
|
||||
use constant {
|
||||
BUILD_NAME => "PBot",
|
||||
BUILD_REVISION => 4518,
|
||||
BUILD_DATE => "2022-03-23",
|
||||
BUILD_REVISION => 4520,
|
||||
BUILD_DATE => "2022-03-31",
|
||||
};
|
||||
|
||||
sub initialize {}
|
||||
|
Loading…
Reference in New Issue
Block a user