From bd4fd4ea27bcb536007ef993054b3831e8dc302c Mon Sep 17 00:00:00 2001 From: Pragmatic Software Date: Sat, 2 Nov 2024 18:29:25 -0700 Subject: [PATCH] pbot-vm: preserve newlines in split_line() --- applets/pbot-vm/host/lib/SplitLine.pm | 3 +-- lib/PBot/VERSION.pm | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/applets/pbot-vm/host/lib/SplitLine.pm b/applets/pbot-vm/host/lib/SplitLine.pm index 72ab6d1d..ec982e28 100644 --- a/applets/pbot-vm/host/lib/SplitLine.pm +++ b/applets/pbot-vm/host/lib/SplitLine.pm @@ -55,7 +55,6 @@ sub split_line ($line, %opts) { $ch = $chars[$i++]; - my $dquote = $quote // 'undef'; $spaces = 0 if $ch ne ' '; if ($escaped) { @@ -101,7 +100,7 @@ sub split_line ($line, %opts) { } if ($ch eq ' ') { - if (++$spaces > 1 and $opts{keep_spaces}) { + if ($opts{keep_spaces} && (++$spaces > 1 || $ch eq "\n")) { $token .= $ch; next; } else { diff --git a/lib/PBot/VERSION.pm b/lib/PBot/VERSION.pm index 2a998f31..70e49e2f 100644 --- a/lib/PBot/VERSION.pm +++ b/lib/PBot/VERSION.pm @@ -25,7 +25,7 @@ use PBot::Imports; # These are set by the /misc/update_version script use constant { BUILD_NAME => "PBot", - BUILD_REVISION => 4825, + BUILD_REVISION => 4826, BUILD_DATE => "2024-11-02", };