aboutsummaryrefslogtreecommitdiff
path: root/lib/IRC/Client.pm6
diff options
context:
space:
mode:
Diffstat (limited to 'lib/IRC/Client.pm6')
-rw-r--r--lib/IRC/Client.pm66
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/IRC/Client.pm6 b/lib/IRC/Client.pm6
index 46832af..dec288f 100644
--- a/lib/IRC/Client.pm6
+++ b/lib/IRC/Client.pm6
@@ -357,7 +357,11 @@ method send-cmd ($cmd, *@args is copy, :$prefix = '', :$server) {
}
}
else {
- @args[*-1] = ':' ~ @args[*-1] if @args && @args[*-1] ~~ / ^':' | ' ' | ^$ /;
+ if @args {
+ my $last := @args[*-1];
+ $last = ':' ~ $last
+ if not $last or $last.starts-with: ':' or $last.match: /\s/;
+ }
self!ssay: :$server, join ' ', $cmd, @args;
}
}