Skip to content
Extraits de code Groupes Projets
Valider 14e59100 rédigé par Alexandre Morignot's avatar Alexandre Morignot
Parcourir les fichiers

bug fixe with the parsing of !get and !tag arguments with spaces

parent 2308c177
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -33,8 +33,7 @@ sub setConf { ...@@ -33,8 +33,7 @@ sub setConf {
} }
sub exec { sub exec {
my @args = @_; my ($kernel, $user, $chan, $msg) = @_;
my ($kernel, $user, $chan, $msg) = @args;
my ($nick, $mask) = split(/!/,$user); my ($nick, $mask) = split(/!/,$user);
if ($msg =~ /^ *!fav(?: ([0-9]+))?/) { if ($msg =~ /^ *!fav(?: ([0-9]+))?/) {
...@@ -48,20 +47,22 @@ sub exec { ...@@ -48,20 +47,22 @@ sub exec {
commands::later::exec($kernel, $nick, $id, $time, $unit); commands::later::exec($kernel, $nick, $id, $time, $unit);
} }
elsif ($msg =~ /^ *!tag(?: +([0-9]+))?/) { elsif ($msg =~ /^( *!tag)(?:( +)([0-9]+))?/) {
my $id = $1; my $id = $3;
if ($id) { if ($id) {
$msg = substr $msg, 4 + (length $id) + 1; $msg = substr $msg, (length $1) + (length $2) + (length $id);
} }
else { else {
$id = $lastID{$chan->[0]}; $id = $lastID{$chan->[0]};
$msg = substr $msg, 4; $msg = substr $msg, (length $1) + (length $2);
} }
commands::tag::exec($id, $msg); commands::tag::exec($id, $msg);
} }
elsif ($msg =~ /^ *!get/) { elsif ($msg =~ /^( *!get)/) {
$msg = substr $msg, length $1;
my @args = ($kernel, $user, $chan, $msg);
my $id = commands::get::exec(@args); my $id = commands::get::exec(@args);
if ($id) { if ($id) {
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter