X-Git-Url: http://git.indexdata.com/?p=tclrobot.git;a=blobdiff_plain;f=robot.tcl;h=9b672cd52968a1164de792fed43818eacd4a45d1;hp=bad9a2505a6d3d639798eee4f23c9878165cf068;hb=aff790b94e4679bf6e1b6e181e9dc28ecf1c75ba;hpb=5467e3fdc675f190e2616c2f24921bd22de5eab4 diff --git a/robot.tcl b/robot.tcl index bad9a25..9b672cd 100755 --- a/robot.tcl +++ b/robot.tcl @@ -1,5 +1,5 @@ #!/usr/bin/tclsh -# $Id: robot.tcl,v 1.11 2001/01/23 11:26:43 adam Exp $ +# $Id: robot.tcl,v 1.12 2001/01/23 14:28:41 adam Exp $ # proc RobotFileNext1 {area lead} { puts "RobotFileNext1 area=$area lead=$lead" @@ -281,16 +281,18 @@ proc RobotHref {url hrefx hostx pathx} { if {![string length $surl]} { set surl / } - set ok 0 - foreach domain $domains { - if {[string match $domain $host]} { - set ok 1 - break + if {[info exist domains]} { + set ok 0 + foreach domain $domains { + if {[string match $domain $host]} { + set ok 1 + break + } } - } - if {!$ok} { - return 0 - } + if {!$ok} { + return 0 + } + } } else { regexp {^([^\#]*)} $hpath x surl set host $URL($url,hostport) @@ -429,7 +431,7 @@ proc RobotTextHtml {url out} { puts $out "" puts $out $nbody puts $out "" - } a { + } -nonest a { if {![info exists parm(href)]} { puts "no href" continue