Update of /cvsroot/aolserver/aolserver/tcl In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv16234 Modified Files: fastpath.tcl file.tcl form.tcl http.tcl nsdb.tcl packages.tcl sendmail.tcl Log Message: Use Tcl 8.4 non-numeric comparison operators where appropriate Index: fastpath.tcl =================================================================== RCS file: /cvsroot/aolserver/aolserver/tcl/fastpath.tcl,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** fastpath.tcl 18 Aug 2004 03:43:20 -0000 1.10 --- fastpath.tcl 19 Jan 2009 12:21:08 -0000 1.11 *************** *** 392,396 **** } } ! if {$type == "application/x-naviwad"} { if {$exists} { if {!$ismw} { --- 392,396 ---- } } ! if {$type eq "application/x-naviwad"} { if {$exists} { if {!$ismw} { Index: file.tcl =================================================================== RCS file: /cvsroot/aolserver/aolserver/tcl/file.tcl,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** file.tcl 1 Nov 2003 16:42:26 -0000 1.4 --- file.tcl 19 Jan 2009 12:21:08 -0000 1.5 *************** *** 89,97 **** } ! if {$code == 1 && $errorCode == "NS_TCL_ABORT"} { return } ! if { $errorPage == "" } { return -code $code \ -errorcode $errorCode -errorinfo $errorInfo $result --- 89,97 ---- } ! if {$code == 1 && $errorCode eq "NS_TCL_ABORT"} { return } ! if { $errorPage eq "" } { return -code $code \ -errorcode $errorCode -errorinfo $errorInfo $result Index: form.tcl =================================================================== RCS file: /cvsroot/aolserver/aolserver/tcl/form.tcl,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** form.tcl 28 May 2003 18:19:14 -0000 1.9 --- form.tcl 19 Jan 2009 12:21:08 -0000 1.10 *************** *** 66,70 **** proc ns_queryget {key {value ""}} { set form [ns_getform] ! if { $form != "" } { set tmp [ns_set iget $form $key] if {[string length $tmp]} { --- 66,70 ---- proc ns_queryget {key {value ""}} { set form [ns_getform] ! if { $form ne "" } { set tmp [ns_set iget $form $key] if {[string length $tmp]} { *************** *** 84,88 **** proc ns_querygetall {key {def_result ""}} { set form [ns_getform] ! if {$form != ""} { set result "" set size [ns_set size $form] --- 84,88 ---- proc ns_querygetall {key {def_result ""}} { set form [ns_getform] ! if {$form ne ""} { set result "" set size [ns_set size $form] *************** *** 99,103 **** } } ! if {[string length $result] == 0} { set result $def_result } --- 99,103 ---- } } ! if {$result eq ""} { set result $def_result } *************** *** 118,122 **** set form [ns_getform] set i -1 ! if { $form != "" } { set i [ns_set ifind $form $key] } --- 118,122 ---- set form [ns_getform] set i -1 ! if { $form ne "" } { set i [ns_set ifind $form $key] } *************** *** 139,143 **** # alter the current conn's urlcharset. # This can cause cached formsets to get flushed. ! if {$charset != ""} { ns_urlcharset $charset } --- 139,143 ---- # alter the current conn's urlcharset. # This can cause cached formsets to get flushed. ! if {$charset ne ""} { ns_urlcharset $charset } *************** *** 151,155 **** set type [ns_set get $hdr content-type] set fp "" ! while {$fp == ""} { set tmpfile [ns_tmpnam] set fp [ns_openexcl $tmpfile] --- 151,155 ---- set type [ns_set get $hdr content-type] set fp "" ! while {$fp eq ""} { set tmpfile [ns_tmpnam] set fp [ns_openexcl $tmpfile] *************** *** 195,199 **** if {[catch { set fp [open $file {RDWR CREAT EXCL} ] } err]} { global errorCode ! if { [lindex $errorCode 1] != "EEXIST"} { return -code error $err } --- 195,199 ---- if {[catch { set fp [open $file {RDWR CREAT EXCL} ] } err]} { global errorCode ! if { [lindex $errorCode 1] ne "EEXIST"} { return -code error $err } *************** *** 217,221 **** unset _ns_form } ! if {[string compare $newform ""] != 0} { set _ns_form $newform } --- 217,221 ---- unset _ns_form } ! if {$newform ne "" } { set _ns_form $newform } Index: http.tcl =================================================================== RCS file: /cvsroot/aolserver/aolserver/tcl/http.tcl,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** http.tcl 24 Jul 2005 04:25:27 -0000 1.14 --- http.tcl 19 Jan 2009 12:21:08 -0000 1.15 *************** *** 71,75 **** # ! if {![string match http://* $url]} { return -code error "Invalid url \"$url\": "\ "ns_httpopen only supports HTTP" --- 71,75 ---- # ! if {![string match "http://*" $url]} { return -code error "Invalid url \"$url\": "\ "ns_httpopen only supports HTTP" *************** *** 84,88 **** set host [lindex $hp 0] set port [lindex $hp 1] ! if {[string match $port ""]} { set port 80 } --- 84,88 ---- set host [lindex $hp 0] set port [lindex $hp 1] ! if {$port eq ""} { set port 80 } *************** *** 103,107 **** _ns_http_puts $timeout $wfd "$method $uri HTTP/1.0\r" ! if {$rqset != ""} { # # There are request headers --- 103,107 ---- _ns_http_puts $timeout $wfd "$method $uri HTTP/1.0\r" ! if {$rqset ne ""} { # # There are request headers *************** *** 141,145 **** # ! if {$pdata != ""} { _ns_http_puts $timeout $wfd "\r\n$pdata\r" } else { --- 141,145 ---- # ! if {$pdata ne ""} { _ns_http_puts $timeout $wfd "\r\n$pdata\r" } else { *************** *** 200,209 **** # ! if {[string match "" $rqset]} { set rqset [ns_set new rqset] ns_set put $rqset "Accept" "*/*\r" ns_set put $rqset "User-Agent" "[ns_info name]-Tcl/[ns_info version]\r" } ! if {$type == ""} { ns_set put $rqset "Content-type" "application/x-www-form-urlencoded" } else { --- 200,209 ---- # ! if {$rqset eq ""} { set rqset [ns_set new rqset] ns_set put $rqset "Accept" "*/*\r" ns_set put $rqset "User-Agent" "[ns_info name]-Tcl/[ns_info version]\r" } ! if {$type eq ""} { ns_set put $rqset "Content-type" "application/x-www-form-urlencoded" } else { *************** *** 216,220 **** set querystring "" ! if {![string match "" $qsset]} { for {set i 0} {$i < [ns_set size $qsset]} {incr i} { set key [ns_set key $qsset $i] --- 216,220 ---- set querystring "" ! if {$qsset ne ""} { for {set i 0} {$i < [ns_set size $qsset]} {incr i} { set key [ns_set key $qsset $i] *************** *** 242,246 **** set length [ns_set iget $headers content-length] ! if {[string match "" $length]} { set length -1 } --- 242,246 ---- set length [ns_set iget $headers content-length] ! if {$length eq ""} { set length -1 } *************** *** 253,257 **** set buf [_ns_http_read $timeout $rfd $length] append page $buf ! if {[string match "" $buf]} { break } --- 253,257 ---- set buf [_ns_http_read $timeout $rfd $length] append page $buf ! if {$buf eq ""} { break } *************** *** 308,312 **** # set location [ns_set iget $headers location] ! if {$location != ""} { ns_set free $headers close $rfd --- 308,312 ---- # set location [ns_set iget $headers location] ! if {$location ne ""} { ns_set free $headers close $rfd *************** *** 316,320 **** set host [lindex $hp 0] set port [lindex $hp 1] ! if {[string match $port ""]} { set port 80 } --- 316,320 ---- set host [lindex $hp 0] set port [lindex $hp 1] ! if {$port eq ""} { set port 80 } *************** *** 328,332 **** set length [ns_set iget $headers content-length] ! if {[string match "" $length]} { set length -1 } --- 328,332 ---- set length [ns_set iget $headers content-length] ! if {$length eq ""} { set length -1 } *************** *** 339,343 **** set buf [_ns_http_read $timeout $rfd $length] append page $buf ! if {[string match "" $buf]} { break } --- 339,343 ---- set buf [_ns_http_read $timeout $rfd $length] append page $buf ! if {$buf eq ""} { break } *************** *** 379,383 **** if {!$nread} { set sel [ns_sockselect -timeout $timeout $sock {} {}] ! if {[string match "" [lindex $sel 0]]} { return -code error "ns_sockreadwait: Timeout waiting for remote" } --- 379,383 ---- if {!$nread} { set sel [ns_sockselect -timeout $timeout $sock {} {}] ! if {"" eq [lindex $sel 0]} { return -code error "ns_sockreadwait: Timeout waiting for remote" } *************** *** 427,431 **** while {!$done && $nline > 0} { set char [read $sock 1] ! if {$char == "\n"} {set done 1} append line $char incr nline -1 --- 427,431 ---- while {!$done && $nline > 0} { set char [read $sock 1] ! if {$char eq "\n"} {set done 1} append line $char incr nline -1 Index: nsdb.tcl =================================================================== RCS file: /cvsroot/aolserver/aolserver/tcl/nsdb.tcl,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** nsdb.tcl 8 Feb 2002 07:56:16 -0000 1.4 --- nsdb.tcl 19 Jan 2009 12:21:08 -0000 1.5 *************** *** 68,85 **** proc ns_dbquotevalue {value {type text}} { ! if {[string match "" $value]} { return "NULL" } ! if {$type == "decimal" \ ! || $type == "double" \ ! || $type == "integer" \ ! || $type == "int" \ ! || $type == "real" \ ! || $type == "smallint" \ ! || $type == "bigint" \ ! || $type == "bit" \ ! || $type == "float" \ ! || $type == "numeric" \ ! || $type == "tinyint"} { return $value } --- 68,85 ---- proc ns_dbquotevalue {value {type text}} { ! if {$value eq ""} { return "NULL" } ! if {$type eq "decimal" \ ! || $type eq "double" \ ! || $type eq "integer" \ ! || $type eq "int" \ ! || $type eq "real" \ ! || $type eq "smallint" \ ! || $type eq "bigint" \ ! || $type eq "bit" \ ! || $type eq "float" \ ! || $type eq "numeric" \ ! || $type eq "tinyint"} { return $value } *************** *** 187,195 **** proc ns_buildsqltime {time ampm} { ! if {[string match "" $time] && [string match "" $ampm]} { return "" } ! if {[string match "" $time] || [string match "" $ampm]} { error "Invalid time: $time $ampm" } --- 187,195 ---- proc ns_buildsqltime {time ampm} { ! if {"" eq $time && "" eq $ampm} { return "" } ! if {"" eq $time || "" eq $ampm} { error "Invalid time: $time $ampm" } *************** *** 204,212 **** } ! if {$ampm == "AM"} { if {$hours == 12} { set hours 0 } ! } elseif {$ampm == "PM"} { if {$hours != 12} { incr hours 12 --- 204,212 ---- } ! if {$ampm eq "AM"} { if {$hours == 12} { set hours 0 } ! } elseif {$ampm eq "PM"} { if {$hours != 12} { incr hours 12 *************** *** 226,232 **** proc ns_buildsqldate {month day year} { ! if {[string match "" $month] \ ! && [string match "" $day] \ ! && [string match "" $year]} { return "" } --- 226,232 ---- proc ns_buildsqldate {month day year} { ! if {"" eq $month \ ! && "" eq $day \ ! && "" eq $year} { return "" } *************** *** 236,242 **** } ! if {[string match "" $month] \ ! || [string match "" $day] \ ! || [string match "" $year] \ || $month < 1 || $month > 12 \ || $day < 1 || $day > 31 \ --- 236,242 ---- } ! if {"" eq $month \ ! || "" eq $day \ ! || "" eq $year \ || $month < 1 || $month > 12 \ || $day < 1 || $day > 31 \ *************** *** 264,268 **** set time [ns_buildsqltime $time $ampm] ! if {[string match "" $date] || [string match "" $time]} { return "" } --- 264,268 ---- set time [ns_buildsqltime $time $ampm] ! if {"" eq $date || "" eq $time} { return "" } Index: packages.tcl =================================================================== RCS file: /cvsroot/aolserver/aolserver/tcl/packages.tcl,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** packages.tcl 18 Sep 2007 01:31:49 -0000 1.7 --- packages.tcl 19 Jan 2009 12:21:08 -0000 1.8 *************** *** 43,49 **** set value [ns_set value $nsSetId $x] ! if {[string eq "library" $key]} { lappend libraryList $value ! } elseif {[string eq "require" $key]} { lappend requireList $value } --- 43,49 ---- set value [ns_set value $nsSetId $x] ! if {"library" eq $key} { lappend libraryList $value ! } elseif {"require" eq $key} { lappend requireList $value } Index: sendmail.tcl =================================================================== RCS file: /cvsroot/aolserver/aolserver/tcl/sendmail.tcl,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** sendmail.tcl 26 Jun 2006 00:28:42 -0000 1.7 --- sendmail.tcl 19 Jan 2009 12:21:08 -0000 1.8 *************** *** 57,61 **** error "Expected a $check status line; got:\n$line" } ! if {![string match "-" [string range $line 3 3]]} { break; } --- 57,61 ---- error "Expected a $check status line; got:\n$line" } ! if {[string range $line 3 3] ne "-"} { break; } *************** *** 82,97 **** ## Get smtp server into, if none then use localhost set smtp [ns_config ns/parameters smtphost] ! if {[string match "" $smtp]} { set smtp [ns_config ns/parameters mailhost] } ! if {[string match "" $smtp]} { set smtp localhost } set timeout [ns_config ns/parameters smtptimeout] ! if {[string match "" $timeout]} { set timeout 60 } set smtpport [ns_config ns/parameters smtpport] ! if {[string match "" $smtpport]} { set smtpport 25 } --- 82,97 ---- ## Get smtp server into, if none then use localhost set smtp [ns_config ns/parameters smtphost] ! if {$smtp eq ""} { set smtp [ns_config ns/parameters mailhost] } ! if {$smtp eq ""} { set smtp localhost } set timeout [ns_config ns/parameters smtptimeout] ! if {$timeout eq ""} { set timeout 60 } set smtpport [ns_config ns/parameters smtpport] ! if {$smtpport eq ""} { set smtpport 25 } *************** *** 103,107 **** set bcclist [list] ! if {![string match "" $bcclist_in]} { foreach bccaddr $bcclist_in { lappend bcclist "[string trim $bccaddr]" --- 103,107 ---- set bcclist [list] ! if {$bcclist_in ne ""} { foreach bccaddr $bcclist_in { lappend bcclist "[string trim $bccaddr]" *************** *** 130,134 **** ## Insert extra headers, if any (not for BCC) set message_id_already_done_p 0 ! if {![string match "" $extraheaders]} { set size [ns_set size $extraheaders] for {set i 0} {$i < $size} {incr i} { --- 130,134 ---- ## Insert extra headers, if any (not for BCC) set message_id_already_done_p 0 ! if {$extraheaders ne ""} { set size [ns_set size $extraheaders] for {set i 0} {$i < $size} {incr i} { *************** *** 188,192 **** ## Terminate body with a solitary period foreach line [split $msg "\n"] { ! if {[string match . $line]} { append data . } --- 188,192 ---- ## Terminate body with a solitary period foreach line [split $msg "\n"] { ! if {"." eq $line} { append data . } |