[vhffs-dev] [1580] strip superfluous spaces at end of commands

[ Thread Index | Date Index | More vhffs.org/vhffs-dev Archives ]


Revision: 1580
Author:   gradator
Date:     2010-03-29 00:06:19 +0200 (Mon, 29 Mar 2010)
Log Message:
-----------
strip superfluous spaces at end of commands

Modified Paths:
--------------
    trunk/vhffs-irc/modobot.pl

Modified: trunk/vhffs-irc/modobot.pl
===================================================================
--- trunk/vhffs-irc/modobot.pl	2010-03-28 21:50:38 UTC (rev 1579)
+++ trunk/vhffs-irc/modobot.pl	2010-03-28 22:06:19 UTC (rev 1580)
@@ -364,6 +364,8 @@
     my $user = Vhffs::User::get_by_ircnick($vhffs, $nick);
     $user = Vhffs::User::get_by_username($vhffs, $nick) unless(defined $user);
 
+    $texte =~ s/\s*$//;
+
     if ($texte =~ m/^${mynick}:\s+accept\s+[0-9]+.*$/)
     {
 		if (is_modo ($user) == 1)
@@ -381,7 +383,7 @@
 			moderate( $oid , 0 , $reason );
 		}
     }
-    elsif ($texte =~ m/^${mynick}:\s+help\s+$/)
+    elsif ($texte =~ m/^${mynick}:\s+help$/)
     {
         irc_msg("Commands :");
         irc_msg("help - show this help");
@@ -398,45 +400,45 @@
 	irc_msg("whois <domain> - give NS for <domain>");
 
    }
-    elsif ($texte =~ m/^${mynick}:\s+list\s+$/)
+    elsif ($texte =~ m/^${mynick}:\s+list$/)
     {
 	list_moderation( 0 );
     }
-    elsif ($texte =~ m/^${mynick}:\s+desc\s+[a-z0-9]+\s+$/)
+    elsif ($texte =~ m/^${mynick}:\s+desc\s+[a-z0-9]+$/)
     {
         my $groupid = $texte;
 	$groupid =~ s/^${mynick}:\s+desc\s+//;
         get_desc ($groupid);
     }
 
-    elsif ($texte =~ m/^${mynick}:\s+web2group\s+[a-z0-9\.\-]+\s+$/)
+    elsif ($texte =~ m/^${mynick}:\s+web2group\s+[a-z0-9\.\-]+$/)
     {
         my $webtogroup = $texte;
         $webtogroup =~ s/^${mynick}:\s+web2group\s+//;
         find_group_from_web($webtogroup);
     }
 
-    elsif ($texte =~ m/^${mynick}:\s+owner\s+[a-z0-9]+\s+$/)
+    elsif ($texte =~ m/^${mynick}:\s+owner\s+[a-z0-9]+$/)
     {
         my $groupid = $texte;
         $groupid =~ s/^${mynick}:\s+owner\s+//;
         owner_info ($groupid);
     }
 
-    elsif ($texte =~ m/^${mynick}:\s+lsgroup\s+[a-z0-9]+\s+$/)
+    elsif ($texte =~ m/^${mynick}:\s+lsgroup\s+[a-z0-9]+$/)
     {
         my $groupid = $texte;
         $groupid =~ s/^${mynick}: lsgroup //;
         fetch_usergroup ($groupid);
     }
-    elsif ($texte =~ m/^${mynick}:\s+quotacheck\s+[0-9]+\s+$/)
+    elsif ($texte =~ m/^${mynick}:\s+quotacheck\s+[0-9]+$/)
     {
         my $limit = $texte;
         $limit =~ s/^${mynick}:\s+quotacheck\s+//;
         quotacheck($limit);
     }
 
-    elsif ($texte =~ m/^${mynick}:\s+getquota\s+[a-z0-9]+\s+$/)
+    elsif ($texte =~ m/^${mynick}:\s+getquota\s+[a-z0-9]+$/)
     {
         my $groupquota = $texte;
         $groupquota =~ s/^${mynick}:\s+getquota\s+//;
@@ -457,7 +459,7 @@
 
     }
 
-    elsif ($texte =~ m/^${mynick}:\s+whois\s+[a-z0-9\.\-]+\s+$/)
+    elsif ($texte =~ m/^${mynick}:\s+whois\s+[a-z0-9\.\-]+$/)
     {
 	my $whois = $texte;
 	$whois =~ s/^${mynick}:\s+whois\s+//;


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/