From: pcanterino <> Date: Tue, 27 Jul 2004 12:30:46 +0000 (+0000) Subject: Commands are now case-insensitive X-Git-Tag: version_2_0~7 X-Git-Url: https://git.p6c8.net/devedit.git/commitdiff_plain/75f5e16d99e4474d8c84ad4dc010f0379f4bd02f Commands are now case-insensitive --- 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()