# HG changeset patch # User Matti Hamalainen # Date 1454106494 -7200 # Node ID 9dd4d2e3a4ac18ea3b29afb4da8306a312480690 # Parent 36869897f21d216c380034c6b4c7de0e1ac7085c urllog: Fix missing http(s)/ftp:// protocol prefix guessing. diff -r 36869897f21d -r 9dd4d2e3a4ac urllog.tcl --- a/urllog.tcl Wed Jan 06 20:41:47 2016 +0200 +++ b/urllog.tcl Sat Jan 30 00:28:14 2016 +0200 @@ -291,10 +291,12 @@ ### Try to guess the URL protocol component (if it is missing) set u_checktld 1 - if {[string match "*www.*" $urlStr] && ![string match "http://*" $urlStr] && ![string match "https://*" $urlStr]} { - set urlStr "http://$urlStr" - } elseif {[string match "*ftp.*" $urlStr] && ![string match "ftp://*" $urlStr]} { - set urlStr "ftp://$urlStr" + if {![string match "http://*" $urlStr] && ![string match "https://*" $urlStr] && ![string match "ftp://*" $urlStr]} { + if {[string match "*www.*" $urlStr]} { + set urlStr "http://$urlStr" + } elseif {[string match "*ftp.*" $urlStr]} { + set urlStr "ftp://$urlStr" + } } ### Handle URLs that have an IPv4-address