patch 80544e6a2108d1f5387f5fd676b89c934181460d
Author: Enrique D. Bosch <presidev@AT@gmail.com>
Date: Wed Jun 8 00:00:48 CEST 2016
* Improve parser of configuration file
diff -rN -u old-idlebiff/idlebiff new-idlebiff/idlebiff
--- old-idlebiff/idlebiff 2024-11-22 16:06:05.958269540 +0100
+++ new-idlebiff/idlebiff 2024-11-22 16:06:05.958269540 +0100
@@ -157,9 +157,10 @@
set cf [ open $config ]
while { [ gets $cf lin ] >= 0 } \
{
- if { [ string range [ string trim $lin ] 0 0 ] == "#" } { continue }
- set lconf [ split $lin = ]
- lassign $lconf key val
+ if { [ string index [ string trim $lin ] 0 ] == "#" } { continue }
+ set sep [ string first = $lin ]
+ set key [ string range $lin 0 [ expr $sep - 1 ] ]
+ set val [ string range $lin [ expr $sep + 1 ] end ]
set conf([ string trim $key]) [ string trim $val ]
}
}