From: dms Date: Mon, 1 Oct 2001 13:05:50 +0000 (+0000) Subject: - should fix "dict 1 shit". fixed by lear X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=24191aafe4058c8cad9f9ded16c182366d4c0e78;p=infobot.git - should fix "dict 1 shit". fixed by lear git-svn-id: https://svn.code.sf.net/p/infobot/code/trunk@515 c11ca15a-4712-0410-83d8-924469b57eb5 --- diff --git a/blootbot/src/Modules/Dict.pl b/blootbot/src/Modules/Dict.pl index a32d93e..3212b62 100644 --- a/blootbot/src/Modules/Dict.pl +++ b/blootbot/src/Modules/Dict.pl @@ -57,7 +57,7 @@ sub Dict { my $total = scalar @results; - if (defined $num and ($num > $total or $num < 0)) { + if (defined $num and ($num > $total or $num < 1)) { &msg($::who, "error: choice in definition is out of range."); return; } @@ -65,7 +65,7 @@ sub Dict { # parse the results. if ($total > 1) { if (defined $num) { - $retval = sprintf("[%d/%d] %s", $num, $total, $results[$num]); + $retval = sprintf("[%d/%d] %s", $num, $total, $results[$num-1]); } else { # suggested by larne and others. my $prefix = "Dictionary '$query' ";