# HG changeset patch # User Matti Hamalainen # Date 1613552449 -7200 # Node ID ecd8fb2b9ad3cef8eb1693f740cf266e1f681b3a # Parent 80db2b265c5fe947d4ccee4e8ab2609db1b1839f urllog: Use regexp splitx instead of string split. diff -r 80db2b265c5f -r ecd8fb2b9ad3 urllog.tcl --- a/urllog.tcl Wed Feb 17 10:55:52 2021 +0200 +++ b/urllog.tcl Wed Feb 17 11:00:49 2021 +0200 @@ -39,6 +39,7 @@ ########################################################################## package require sqlite3 package require http +package require textutil::split set urllog_name "URLLog" set urllog_version "2.7.0" @@ -542,7 +543,7 @@ ### Check the channel if {[utl_match_delim_list $urllog_log_channels $uchan]} { ### Do the URL checking - foreach str [split $utext " "] { + foreach str [::textutil::split::splitx $utext {\s+}] { if {[regexp "(\[a-z]+://\[^\[:space:\]\]+|^(www|ftp)\.\[^\[:space:\]\]+)" $str ulink]} { urllog_check_url $str $unick $uhost $uchan } @@ -566,9 +567,9 @@ } ### Parse the given command - urllog_log "$unick/$uhand searched URL: $utext" + urllog_log "${unick}/${uhand} searched URL: ${utext}" - set ftokens [split $utext " "] + set ftokens [::textutil::split::splitx $utext {\s+}] set fpatlist "" foreach ftoken $ftokens { set fprefix [string range $ftoken 0 0]