Index: openacs-4/packages/acs-api-browser/www/proc-search.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-api-browser/www/proc-search.tcl,v diff -u -r1.11 -r1.12 --- openacs-4/packages/acs-api-browser/www/proc-search.tcl 15 Sep 2003 11:34:08 -0000 1.11 +++ openacs-4/packages/acs-api-browser/www/proc-search.tcl 10 Jan 2007 21:22:01 -0000 1.12 @@ -51,7 +51,7 @@ } # Exact name search -if { [string equal $name_weight "exact"] } { +if {$name_weight eq "exact"} { set name_weight 5 set exact_match_p 1 } else { @@ -80,17 +80,17 @@ ##Exact match: if {[string tolower $query_string] == [string tolower $proc]} { - incr score [expr $name_weight * 2] + incr score [expr {$name_weight * 2}] } elseif { ! $exact_match_p } { - incr score [expr $name_weight * [ad_keywords_score $query_string $proc]] + incr score [expr {$name_weight * [ad_keywords_score $query_string $proc]}] } } ################ ## Param Search: ################ if {$param_weight} { - incr score [expr $param_weight * [ad_keywords_score $query_string "$doc_elements(positionals) $doc_elements(switches)"]] + incr score [expr {$param_weight * [ad_keywords_score $query_string "$doc_elements(positionals) $doc_elements(switches)"]}] } @@ -100,15 +100,15 @@ if {$doc_weight} { set doc_string "[lindex $doc_elements(main) 0]" - if [info exists doc_elements(param)] { + if {[info exists doc_elements(param)]} { foreach parameter $doc_elements(param) { append doc_string " $parameter" } } - if [info exists doc_elements(return)] { + if {[info exists doc_elements(return)]} { append doc_string " $doc_elements(return)" } - incr score [expr $doc_weight * [ad_keywords_score $query_string $doc_string]] + incr score [expr {$doc_weight * [ad_keywords_score $query_string $doc_string]}] } @@ -117,7 +117,7 @@ ################# if {$source_weight} { if {![catch {set source [info body $proc]}]} { - incr score [expr $source_weight * [ad_keywords_score $query_string $source]] + incr score [expr {$source_weight * [ad_keywords_score $query_string $source]}] } } @@ -143,7 +143,7 @@ set matches [lsort -command ad_sort_by_score_proc $matches] -if {$quick_view && ![empty_string_p $matches] || [llength $matches] == 1 } { +if {$quick_view && $matches ne "" || [llength $matches] == 1 } { ad_returnredirect [api_proc_url [lindex [lindex $matches 0] 0]] ad_script_abort }