From 75f5e16d99e4474d8c84ad4dc010f0379f4bd02f Mon Sep 17 00:00:00 2001 From: pcanterino <> Date: Tue, 27 Jul 2004 12:30:46 +0000 Subject: [PATCH 1/1] Commands are now case-insensitive --- modules/Command.pm | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/modules/Command.pm b/modules/Command.pm index d0070c4..17f9470 100644 --- a/modules/Command.pm +++ b/modules/Command.pm @@ -6,7 +6,7 @@ package Command; # Execute Dev-Editor's commands # # Author: Patrick Canterino -# Last modified: 2004-07-22 +# Last modified: 2004-07-27 # use strict; @@ -61,10 +61,16 @@ sub exec_command($$$) { my ($command,$data,$config) = @_; - return error($config->{'errors'}->{'cmd_unknown'},'/',{COMMAND => $command}) unless($dispatch{$command}); + foreach(keys(%dispatch)) + { + if(lc($_) eq lc($command)) + { + my $output = &{$dispatch{$_}}($data,$config); + return $output; + } + } - my $output = &{$dispatch{$command}}($data,$config); - return $output; + return error($config->{'errors'}->{'cmd_unknown'},'/',{COMMAND => $command}); } # exec_show() -- 2.34.1