]> git.donarmstrong.com Git - infobot.git/commitdiff
fix for endless loop. asuffield.
authordms <dms@c11ca15a-4712-0410-83d8-924469b57eb5>
Wed, 28 Feb 2001 12:17:10 +0000 (12:17 +0000)
committerdms <dms@c11ca15a-4712-0410-83d8-924469b57eb5>
Wed, 28 Feb 2001 12:17:10 +0000 (12:17 +0000)
git-svn-id: https://svn.code.sf.net/p/infobot/code/trunk/blootbot@419 c11ca15a-4712-0410-83d8-924469b57eb5

src/Factoids/Question.pl

index e6b0818fd88794ebcb0418654993adc6115f4956..a356f82a402fe07f3f066223b48a1f75c9940f66 100644 (file)
@@ -82,7 +82,7 @@ sub doQuestion {
     }
 
     my @link;
-    for (my$i=0; $i<scalar(@query); $i++) {
+    for (my$i=0; $i<scalar @query; $i++) {
        $query  = $query[$i];
        $result = &getReply($query);
        next if (!defined $result or $result eq "");
@@ -104,7 +104,8 @@ sub doQuestion {
 
            push(@link, $link);
            my $newr = &getReply($link);
-           $result  = $newr    if ($newr ne "");
+           last if (!defined $newr or $newr eq "");
+           $result  = $newr;
        }
 
        if (@link) {