3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-12-24 03:33:06 +01:00

Factoids: Fix typo and edge case

This commit is contained in:
Pragmatic Software 2020-06-11 23:34:53 -07:00
parent c95afe65bc
commit 90b23d5391

View File

@ -750,7 +750,7 @@ sub expand_factoid_vars {
my $var;
my $extract_method;
if ($action =~ /^\{.*?\}/) {
if ($rest =~ /^\{.*?\}/) {
($var, $rest) = $self->{pbot}->{interpreter}->extract_bracketed($rest, '{', '}');
if ($var =~ /:/) {
@ -847,7 +847,15 @@ sub expand_factoid_vars {
}
}
last if $matches == 0 or $expansions == 0;
if ($matches == 0 or $expansions == 0) {
if (length $rest) {
$rest = $result . $rest;
$result = '';
next;
} else {
last;
}
}
if (not length $rest) {
$rest = $result;