Index: openacs-4/packages/acs-lang/tcl/lang-message-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-lang/tcl/lang-message-procs.tcl,v diff -u -r1.51.8.4 -r1.51.8.5 --- openacs-4/packages/acs-lang/tcl/lang-message-procs.tcl 17 Sep 2013 22:21:36 -0000 1.51.8.4 +++ openacs-4/packages/acs-lang/tcl/lang-message-procs.tcl 2 Oct 2013 09:10:21 -0000 1.51.8.5 @@ -650,7 +650,7 @@ if { [llength $value_array_list] > 0 } { # A substitution list is provided, the key should be in there - if { [lsearch -exact $value_array_keys $variable_string] == -1 } { + if {$variable_string ni $value_array_keys} { ns_log Warning "lang::message::format: The value_array_list \"$value_array_list\" does not contain the variable name $variable_string found in the message: $localized_message" # There is no value available to do the substitution with Index: openacs-4/packages/acs-lang/tcl/lang-util-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-lang/tcl/lang-util-procs.tcl,v diff -u -r1.47.2.1 -r1.47.2.2 --- openacs-4/packages/acs-lang/tcl/lang-util-procs.tcl 27 Aug 2013 12:20:35 -0000 1.47.2.1 +++ openacs-4/packages/acs-lang/tcl/lang-util-procs.tcl 2 Oct 2013 09:10:22 -0000 1.47.2.2 @@ -338,15 +338,15 @@ # The replacement string starts and ends with a hash mark set replacement_string [string range $string_with_hashes [lindex $item_idx 0] \ [lindex $item_idx 1]] - set message_key [string range $replacement_string 1 [expr {[string length $replacement_string] - 2}]] + set message_key [string range $replacement_string 1 [string length $replacement_string]-2] # Attempt a message lookup set message_value [lang::message::lookup $locale $message_key "" "" 2] # Replace the string # LARS: We don't use regsub here, because regsub interprets certain characters # in the replacement string specially. - append subst_string [string range $string_with_hashes $start_idx [expr {[lindex $item_idx 0]-1}]] + append subst_string [string range $string_with_hashes $start_idx [lindex $item_idx 0]-1] append subst_string $message_value set start_idx [expr {[lindex $item_idx 1] + 1}] @@ -702,7 +702,7 @@ if { [ad_conn locale] ne "en_US" } { if { ![info exists __lang_message_lookups] } { lappend __lang_message_lookups $message_key - } elseif { [lsearch -exact $__lang_message_lookups $message_key] == -1 } { + } elseif {$message_key ni $__lang_message_lookups} { lappend __lang_message_lookups $message_key } } Index: openacs-4/packages/acs-lang/tcl/locale-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-lang/tcl/locale-procs.tcl,v diff -u -r1.38.2.1 -r1.38.2.2 --- openacs-4/packages/acs-lang/tcl/locale-procs.tcl 27 Aug 2013 12:20:35 -0000 1.38.2.1 +++ openacs-4/packages/acs-lang/tcl/locale-procs.tcl 2 Oct 2013 09:10:22 -0000 1.38.2.2 @@ -42,7 +42,7 @@ # Check validity of parameter setting set valid_locales [lang::system::get_locales] - if { [lsearch -exact $valid_locales $parameter_locale] == -1 } { + if {$parameter_locale ni $valid_locales} { ns_log Error "The parameter setting acs-lang.SiteWideLocale=\"$parameter_locale\" is invalid. Valid locales are: \"$valid_locales\". Defaulting to en_US locale" return en_US } @@ -572,7 +572,7 @@ if { ([info exists region] && $region ne "") } { # We have both language and region, e.g. en_US - if { [lsearch -exact $system_locales $locale] != -1 } { + if {$locale in $system_locales} { # The locale was found in the system, a perfect match set perfect_match $locale break Index: openacs-4/packages/acs-lang/tcl/localization-data-init.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-lang/tcl/localization-data-init.tcl,v diff -u -r1.18 -r1.18.10.1 --- openacs-4/packages/acs-lang/tcl/localization-data-init.tcl 10 Jan 2007 21:22:04 -0000 1.18 +++ openacs-4/packages/acs-lang/tcl/localization-data-init.tcl 2 Oct 2013 09:10:22 -0000 1.18.10.1 @@ -122,9 +122,9 @@ # Straight (localian) lookups set percent_match(a) {[lindex [lc_get -locale $locale "abday"] $lc_time_day_no]} set percent_match(A) {[lindex [lc_get -locale $locale "day"] $lc_time_day_no]} - set percent_match(b) {[lindex [lc_get -locale $locale "abmon"] [expr {$lc_time_month-1}]]} - set percent_match(h) {[lindex [lc_get -locale $locale "abmon"] [expr {$lc_time_month-1}]]} - set percent_match(B) {[lindex [lc_get -locale $locale "mon"] [expr {$lc_time_month-1}]]} + set percent_match(b) {[lindex [lc_get -locale $locale "abmon"] $lc_time_month-1]} + set percent_match(h) {[lindex [lc_get -locale $locale "abmon"] $lc_time_month-1]} + set percent_match(B) {[lindex [lc_get -locale $locale "mon"] $lc_time_month-1]} set percent_match(p) {[lc_time_name_meridian $locale $lc_time_hours]} # Finally, static string replacements Index: openacs-4/packages/acs-lang/tcl/localization-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-lang/tcl/localization-procs.tcl,v diff -u -r1.23.8.3 -r1.23.8.4 --- openacs-4/packages/acs-lang/tcl/localization-procs.tcl 24 Sep 2013 18:56:33 -0000 1.23.8.3 +++ openacs-4/packages/acs-lang/tcl/localization-procs.tcl 2 Oct 2013 09:10:22 -0000 1.23.8.4 @@ -137,8 +137,7 @@ } { # with empty seperator or grouping string we behave # posixly - if {$grouping eq "" - || $sep eq "" } { + if {$grouping eq "" || $sep eq "" } { return $num } @@ -148,7 +147,7 @@ set match "^(-?$num_re+)(" set group [lindex $grouping 0] - while { 1 && $group > 0} { + while { $group > 0} { set re "$match[string repeat $num_re $group])" if { ![regsub -- $re $num "\\1$sep\\2" num] } { break @@ -328,12 +327,12 @@ } } - set a [expr (14 - $lc_time_month) / 12] + set a [expr {(14 - $lc_time_month) / 12}] set y [expr {$lc_time_year - $a}] set m [expr {$lc_time_month + 12*$a - 2}] # day_no becomes 0 for Sunday, through to 6 for Saturday. Perfect for addressing zero-based lists pulled from locale info. - set lc_time_day_no [expr (($lc_time_days + $y + ($y/4) - ($y / 100) + ($y / 400)) + ((31*$m) / 12)) % 7] + set lc_time_day_no [expr {(($lc_time_days + $y + $y/4 - $y/100 + $y/400) + (31 * $m / 12)) % 7}] return [subst [util_memoize "lc_time_fmt_compile {$fmt} $locale"]] } Index: openacs-4/packages/acs-lang/tcl/test/acs-lang-test-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-lang/tcl/test/acs-lang-test-procs.tcl,v diff -u -r1.17.10.1 -r1.17.10.2 --- openacs-4/packages/acs-lang/tcl/test/acs-lang-test-procs.tcl 12 Sep 2013 16:25:48 -0000 1.17.10.1 +++ openacs-4/packages/acs-lang/tcl/test/acs-lang-test-procs.tcl 2 Oct 2013 09:10:22 -0000 1.17.10.2 @@ -61,7 +61,7 @@ -enable \ [apm_package_info_file_path $package_key] aa_true "Package install: package enabled" \ - [expr [lsearch -exact [apm_enabled_packages] $package_key] != -1] + [expr {$package_key in [apm_enabled_packages]}] } ad_proc -private lang::test::teardown_test_package {} { @@ -554,7 +554,7 @@ set tcl_file_id [open "[acs_root_dir]/$tcl_file" r] set updated_tcl_contents [read $tcl_file_id] close $tcl_file_id - aa_true "tags in tcl file replaced" [expr [llength [lang::util::get_temporary_tags_indices $updated_tcl_contents]] == 0] + aa_true "tags in tcl file replaced" [expr {[llength [lang::util::get_temporary_tags_indices $updated_tcl_contents]] == 0}] # Delete the test message keys foreach message_key [concat [array names messages_array] $expected_new_keys] { @@ -588,8 +588,8 @@ set expected_index_item [lindex $expected_indices_list $counter] aa_true "checking start and end indices of item $counter" \ - [expr [string equal [lindex $index_item 0] [lindex $expected_index_item 0]] && \ - [string equal [lindex $index_item 1] [lindex $expected_index_item 1]]] + [expr {[lindex $index_item 0] eq [lindex $expected_index_item 0] + && [lindex $index_item 1] eq [lindex $expected_index_item 1]}] set counter [expr {$counter + 1}] } Index: openacs-4/packages/acs-lang/www/admin/message-usage-include.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-lang/www/admin/message-usage-include.tcl,v diff -u -r1.5 -r1.5.10.1 --- openacs-4/packages/acs-lang/www/admin/message-usage-include.tcl 10 Jan 2007 21:22:04 -0000 1.5 +++ openacs-4/packages/acs-lang/www/admin/message-usage-include.tcl 2 Oct 2013 09:10:22 -0000 1.5.10.1 @@ -28,8 +28,8 @@ set colon [string first ":" $line] multirow append message_usage \ - [string range $line 0 [expr {$colon-1}]] \ - [string trim [string range $line [expr {$colon+1}] end]] + [string range $line 0 $colon-1] \ + [string trim [string range $line $colon+1 end]] } } } Index: openacs-4/packages/acs-lang/www/admin/package-list.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-lang/www/admin/package-list.tcl,v diff -u -r1.10 -r1.10.4.1 --- openacs-4/packages/acs-lang/www/admin/package-list.tcl 7 Apr 2011 16:28:27 -0000 1.10 +++ openacs-4/packages/acs-lang/www/admin/package-list.tcl 2 Oct 2013 09:10:22 -0000 1.10.4.1 @@ -28,7 +28,7 @@ set page_title $locale_label set context [list $page_title] -set locale_enabled_p [expr [lsearch [lang::system::get_locales] $current_locale] != -1] +set locale_enabled_p [expr {[lsearch [lang::system::get_locales] $current_locale] != -1}] set site_wide_admin_p [acs_user::site_wide_admin_p] Index: openacs-4/packages/acs-lang/www/admin/set-system-timezone.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-lang/www/admin/set-system-timezone.tcl,v diff -u -r1.10 -r1.10.2.1 --- openacs-4/packages/acs-lang/www/admin/set-system-timezone.tcl 27 Jul 2012 21:57:13 -0000 1.10 +++ openacs-4/packages/acs-lang/www/admin/set-system-timezone.tcl 2 Oct 2013 09:10:22 -0000 1.10.2.1 @@ -104,12 +104,8 @@ set try_offsets [list] foreach offset [list $recommended_offset [expr {$recommended_offset -24}]] { - # LARS 2003-11-05 - # This is a workaround for a Tcl 8.3 bug on Solaris that causes int() on negative decimal - # numbers to fail with "integer value too large to represent". - # Example: 'expr int(-1.0)' throws an error; 'expr int(-1)' does not. if { $offset < 0 } { - lappend try_offsets "'[db_quote [expr -int(abs($offset)*60*60)]]'" + lappend try_offsets "'[db_quote [expr {-int(abs($offset)*60*60)]}]'" } else { lappend try_offsets "'[db_quote [expr {int($offset*60*60)}]]'" } Index: openacs-4/packages/acs-lang/www/doc/acs4-patches.txt =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-lang/www/doc/acs4-patches.txt,v diff -u -r1.1.1.1 -r1.1.1.1.28.1 --- openacs-4/packages/acs-lang/www/doc/acs4-patches.txt 20 Apr 2001 20:51:09 -0000 1.1.1.1 +++ openacs-4/packages/acs-lang/www/doc/acs4-patches.txt 2 Oct 2013 09:10:23 -0000 1.1.1.1.28.1 @@ -188,7 +188,7 @@ } # Is the "static" attribute present? - set static_p [expr [ns_set find $params static] >= 0] + set static_p [expr {[ns_set find $params static] >= 0}] # If "static" attribute is present, do the call now if {$static_p} {