mirror of
https://github.com/pragma-/pbot.git
synced 2024-11-23 12:29:27 +01:00
Factoids: Fix expansions for real
This commit is contained in:
parent
743f5c36b3
commit
ec117c4aec
@ -492,18 +492,32 @@ sub expand_factoid_vars {
|
||||
|
||||
if (not length $mylist[$line]) {
|
||||
$self->{pbot}->{logger}->log("No length!\n") if $debug;
|
||||
if ($debug) {
|
||||
$self->{pbot}->{logger}->log("before: v: $v, offset: $offset\n");
|
||||
$self->{pbot}->{logger}->log("$action\n");
|
||||
$self->{pbot}->{logger}->log((" " x $offset) . "^\n");
|
||||
}
|
||||
|
||||
substr($action, $offset) =~ s/\s*$a\$$v$modifier//;
|
||||
$offset += $-[0];
|
||||
|
||||
if ($debug) {
|
||||
$self->{pbot}->{logger}->log("after: \$-[0]: $-[0], offset: $offset\n");
|
||||
$self->{pbot}->{logger}->log("after: \$-[0]: $-[0], offset: $offset, r: EMPTY\n");
|
||||
$self->{pbot}->{logger}->log("$action\n");
|
||||
$self->{pbot}->{logger}->log((" " x $offset) . "^\n");
|
||||
}
|
||||
} else {
|
||||
substr($action, $offset) =~ s/$a\$$v$modifier/$mylist[$line]/;
|
||||
$offset += $-[0];
|
||||
if ($debug) {
|
||||
$self->{pbot}->{logger}->log("after: \$-[0]: $-[0], offset: $offset\n");
|
||||
$self->{pbot}->{logger}->log("before: v: $v, offset: $offset\n");
|
||||
$self->{pbot}->{logger}->log("$action\n");
|
||||
$self->{pbot}->{logger}->log((" " x $offset) . "^\n");
|
||||
}
|
||||
|
||||
substr($action, $offset) =~ s/($a\$$v$modifier)/$mylist[$line]/;
|
||||
$offset += $-[0] + length $mylist[$line];
|
||||
|
||||
if ($debug) {
|
||||
$self->{pbot}->{logger}->log("after: \$-[0]: $-[0], offset: $offset, r: $mylist[$line]\n");
|
||||
$self->{pbot}->{logger}->log("$action\n");
|
||||
$self->{pbot}->{logger}->log((" " x $offset) . "^\n");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user