changeset 651:ecd8fb2b9ad3

urllog: Use regexp splitx instead of string split.
author Matti Hamalainen <ccr@tnsp.org>
date Wed, 17 Feb 2021 11:00:49 +0200
parents 80db2b265c5f
children aa317575410d
files urllog.tcl
diffstat 1 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- 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]