]> git.donarmstrong.com Git - infobot.git/commitdiff
- ok, if there are no hits, make sure $num is undefined.
authordms <dms@c11ca15a-4712-0410-83d8-924469b57eb5>
Thu, 28 Mar 2002 21:12:20 +0000 (21:12 +0000)
committerdms <dms@c11ca15a-4712-0410-83d8-924469b57eb5>
Thu, 28 Mar 2002 21:12:20 +0000 (21:12 +0000)
git-svn-id: https://svn.code.sf.net/p/infobot/code/trunk@557 c11ca15a-4712-0410-83d8-924469b57eb5

blootbot/src/Modules/Dict.pl

index 22b6422bca472c1c063706eb7e49e76b21047166..b055299c8e63d9453e0bb28e7fcbdbc0b4b14cfa 100644 (file)
@@ -31,7 +31,7 @@ sub Dict {
     # connect.
     socket($socket, PF_INET, SOCK_STREAM, $proto) or return "error: socket: $!";
     eval {
-       alarm 15;
+       alarm 10;
        connect($socket, sockaddr_in($port, inet_aton($server))) or return "error: connect: $!";
        alarm 0;
     };
@@ -57,6 +57,10 @@ sub Dict {
 
        my $total = scalar @results;
 
+       if ($total == 0) {
+           $num = undef;
+       }
+
        if (defined $num and ($num > $total or $num < 1)) {
            &::msg($::who, "error: choice in definition is out of range.");
            return;