From 362310b8638b17a8cb69d76cf1b796ee666fd0ec Mon Sep 17 00:00:00 2001 From: Elijah Perrault Date: Wed, 20 Apr 2011 20:56:02 -0600 Subject: [PATCH] Regex is a bad idea for this. --- lib/Proto/IRC.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Proto/IRC.pm b/lib/Proto/IRC.pm index 684fecd..8e7f01d 100644 --- a/lib/Proto/IRC.pm +++ b/lib/Proto/IRC.pm @@ -630,7 +630,7 @@ sub privmsg { # Ensure it's a valid length. if (length($ex[3]) > 2) { $cmd = uc substr $ex[3], 1; - $cmd =~ s/^$cprefix//xsm; + if (substr($cmd, 0, 1) eq $cprefix) { $cmd = substr $cmd, 1 } if (defined $API::Std::CMDS{$cmd}) { # If this is indeed a command, continue. if ($API::Std::CMDS{$cmd}{lvl} == 1 or $API::Std::CMDS{$cmd}{lvl} == 2) {