Index: openacs-4/packages/acs-templating/tcl/util-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/tcl/util-procs.tcl,v diff -u -N -r1.24 -r1.25 --- openacs-4/packages/acs-templating/tcl/util-procs.tcl 29 Jul 2006 23:10:33 -0000 1.24 +++ openacs-4/packages/acs-templating/tcl/util-procs.tcl 10 Jan 2007 21:22:12 -0000 1.25 @@ -38,7 +38,7 @@ # Get the next arg set next [lindex $argv [incr i]] - if { ! [string equal [string index $next 0] "-"] || + if { [string index $next 0] ne "-" || ! [regexp {[a-zA-Z*]} [string index $next 1] match] } { # the next arg was not a switch so assume it is a parameter @@ -91,7 +91,7 @@ # check for an array as well if { [array exists var] } { return 0 } - if { [info exists var] && ! [string equal $var {}] } { + if { [info exists var] && $var ne {} } { set result 0 } else { set result 1 @@ -123,7 +123,7 @@ set count [db_string get_count $query] - return [expr $count == 0] + return [expr {$count == 0}] } ad_proc -public template::util::is_true { x } { @@ -146,7 +146,7 @@ upvar $ref the_list - set the_list [lrange $the_list 0 [expr [llength $the_list] - 2]] + set the_list [lrange $the_list 0 [expr {[llength $the_list] - 2}]] } ad_proc -public template::util::lnest { listref value next args } { @@ -462,7 +462,7 @@ set output_charset [ns_config "ns/parameters" OutputCharset] set tcl_charset [ns_encodingforcharset $output_charset] - if { ![empty_string_p $tcl_charset] } { + if { $tcl_charset ne "" } { fconfigure $file_channel_id -encoding $tcl_charset } } @@ -488,7 +488,7 @@ Resolve a URL into an absolute file path. } { - if { [string index $url 0] != "/" } { + if { [string index $url 0] ne "/" } { set path [file dirname $reference_url]/$url @@ -518,13 +518,13 @@ } { set directory $url - set lastchar [string range $url [expr [string length $url]-1] end] + set lastchar [string range $url [expr {[string length $url]-1}] end] - if {! [string equal $lastchar /]} { + if {$lastchar ne "/" } { set directory [file dirname $url]/ - if { [string equal $directory //] } { + if {$directory eq "//"} { # root directory is a special case set directory / } @@ -573,7 +573,7 @@ default { - set time [expr [ns_time] + ($expire_state * 60)] + set time [expr {[ns_time] + ($expire_state * 60)}] append cookie ";expires=[ns_httptime $time]" } } @@ -690,7 +690,7 @@ } set value [ns_config $section $key ""] - if { [string equal $value ""] } { + if {$value eq ""} { return "" } else { # Cache the value and return it @@ -766,17 +766,17 @@ } { set varlist "" - foreach i [if $level { + foreach i [if {$level} { uplevel \#$level {info locals} } else {info globals} ] { append varlist "