Index: openacs-4/packages/xotcl-request-monitor/tcl/throttle_mod-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xotcl-request-monitor/tcl/throttle_mod-procs.tcl,v diff -u -N -r1.67.2.38 -r1.67.2.39 --- openacs-4/packages/xotcl-request-monitor/tcl/throttle_mod-procs.tcl 26 Jan 2021 21:00:12 -0000 1.67.2.38 +++ openacs-4/packages/xotcl-request-monitor/tcl/throttle_mod-procs.tcl 1 Feb 2021 10:47:36 -0000 1.67.2.39 @@ -1507,7 +1507,7 @@ puts -nonewline $dumpFile [join $cmds \n]\n close $dumpFile } else { - file delete -force ${:file} + file delete -force -- ${:file} set dumpFile [AsyncLogFile new -filename ${:file}] # # Write the content in smaller chunks. Index: openacs-4/packages/xotcl-request-monitor/www/long-calls.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xotcl-request-monitor/www/long-calls.tcl,v diff -u -N -r1.4.2.6 -r1.4.2.7 --- openacs-4/packages/xotcl-request-monitor/www/long-calls.tcl 15 Jul 2020 19:45:18 -0000 1.4.2.6 +++ openacs-4/packages/xotcl-request-monitor/www/long-calls.tcl 1 Feb 2021 10:47:36 -0000 1.4.2.7 @@ -24,7 +24,7 @@ } proc ::xo::regsub_eval {re string cmd {prefix ""}} { set map { \" \\\" \[ \\[ \] \\] \$ \\$ \\ \\\\} - return [uplevel [list subst [regsub -all $re [string map $map $string] "\[$cmd\]"]]] + return [uplevel [list subst [regsub -all -- $re [string map $map $string] "\[$cmd\]"]]] } proc ::xo::subst_user_link {prefix uid} { return $prefix[::xo::userid_link $uid] Index: openacs-4/packages/acs-tcl/tcl/01-database-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/Attic/01-database-procs.tcl,v diff -u -N -r1.1.2.20 -r1.1.2.21 --- openacs-4/packages/acs-tcl/tcl/01-database-procs.tcl 8 Dec 2020 14:33:45 -0000 1.1.2.20 +++ openacs-4/packages/acs-tcl/tcl/01-database-procs.tcl 1 Feb 2021 10:51:08 -0000 1.1.2.21 @@ -321,7 +321,7 @@ ad_proc -public db_quote { string } { Quotes a string value to be placed in a SQL statement. } { - regsub -all {'} "$string" {''} result + regsub -all -- {'} "$string" {''} result return $result } Index: openacs-4/packages/acs-tcl/tcl/adp-parser-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/adp-parser-procs.tcl,v diff -u -N -r1.5.2.1 -r1.5.2.2 --- openacs-4/packages/acs-tcl/tcl/adp-parser-procs.tcl 13 Jul 2020 12:02:33 -0000 1.5.2.1 +++ openacs-4/packages/acs-tcl/tcl/adp-parser-procs.tcl 1 Feb 2021 10:51:08 -0000 1.5.2.2 @@ -59,8 +59,8 @@ Quotes special Tcl characters and newlines. } { - regsub -all {([\{\}\[\]\$\"\\])} $string {\\\1} string - regsub -all {\n} $string {\\n} string + regsub -all -- {([\{\}\[\]\$\"\\])} $string {\\\1} string + regsub -all -- {\n} $string {\\n} string return "\"$string\"" } Index: openacs-4/packages/acs-tcl/tcl/apm-install-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/apm-install-procs.tcl,v diff -u -N -r1.126.2.12 -r1.126.2.13 --- openacs-4/packages/acs-tcl/tcl/apm-install-procs.tcl 28 Oct 2020 15:39:19 -0000 1.126.2.12 +++ openacs-4/packages/acs-tcl/tcl/apm-install-procs.tcl 1 Feb 2021 10:51:08 -0000 1.126.2.13 @@ -2340,7 +2340,7 @@ where package_key = :package_key } { # Removing the character "#". - regsub -all {[\#]*} $instance_name {\1} instance_name + regsub -all -- {[\#]*} $instance_name {\1} instance_name # Verifying whether this instance_name is a message_key set is_msg [lang::message::message_exists_p [ad_conn locale] $instance_name] Index: openacs-4/packages/acs-tcl/tcl/apm-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/apm-procs.tcl,v diff -u -N -r1.114.2.24 -r1.114.2.25 --- openacs-4/packages/acs-tcl/tcl/apm-procs.tcl 1 Dec 2020 09:27:11 -0000 1.114.2.24 +++ openacs-4/packages/acs-tcl/tcl/apm-procs.tcl 1 Feb 2021 10:51:08 -0000 1.114.2.25 @@ -956,7 +956,7 @@ Returns a CVS release tag for a particular package key and version name. } { - regsub -all {\.} [string toupper "$package_key-$version_name"] "-" release_tag + regsub -all -- {\.} [string toupper "$package_key-$version_name"] "-" release_tag return $release_tag } @@ -1485,7 +1485,7 @@ } { set procedure_name [string tolower "[string trim $package_key]_post_instantiation"] # Change all "-" to "_" to mimic our Tcl standards - regsub -all {\-} $procedure_name "_" procedure_name + regsub -all -- {\-} $procedure_name "_" procedure_name if { [namespace which ::$procedure_name] eq "" } { # No such procedure exists... return "" Index: openacs-4/packages/acs-tcl/tcl/deprecated-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/deprecated-procs.tcl,v diff -u -N -r1.29.2.10 -r1.29.2.11 --- openacs-4/packages/acs-tcl/tcl/deprecated-procs.tcl 28 Oct 2020 15:39:19 -0000 1.29.2.10 +++ openacs-4/packages/acs-tcl/tcl/deprecated-procs.tcl 1 Feb 2021 10:51:08 -0000 1.29.2.11 @@ -1739,7 +1739,7 @@ } else { set out $options } - regsub -all {@@} $out $i out + regsub -all -- {@@} $out $i out append html "[expr {$i + 1}]$out\n" } } Index: openacs-4/packages/acs-tcl/tcl/html-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/html-procs.tcl,v diff -u -N -r1.5.2.2 -r1.5.2.3 --- openacs-4/packages/acs-tcl/tcl/html-procs.tcl 6 Dec 2020 08:45:47 -0000 1.5.2.2 +++ openacs-4/packages/acs-tcl/tcl/html-procs.tcl 1 Feb 2021 10:51:09 -0000 1.5.2.3 @@ -162,7 +162,7 @@ } # Formfield's name can contain colons, # I need to escape them. - regsub -all {:} $name {\:} name + regsub -all -- {:} $name {\:} name lappend vars [list $name $value] } Index: openacs-4/packages/acs-tcl/tcl/install-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/install-procs.tcl,v diff -u -N -r1.35.2.4 -r1.35.2.5 --- openacs-4/packages/acs-tcl/tcl/install-procs.tcl 27 Sep 2020 17:56:56 -0000 1.35.2.4 +++ openacs-4/packages/acs-tcl/tcl/install-procs.tcl 1 Feb 2021 10:51:09 -0000 1.35.2.5 @@ -113,7 +113,7 @@ set out [list] # Remove double slashes - regsub -all {//} $mount_point "/" mount_point + regsub -all -- {//} $mount_point "/" mount_point set mount_point [string trim $mount_point " /"] if {[string is space $mount_point] || $mount_point eq "/"} { @@ -197,7 +197,7 @@ set out [list] # Remove double slashes - regsub -all {//} $mount_point "/" mount_point + regsub -all -- {//} $mount_point "/" mount_point set mount_point [string trim $mount_point " /"] if {[string is space $mount_point] || $mount_point eq "/"} { @@ -1038,7 +1038,7 @@ } # Remove double slashes - regsub -all {//} $url "/" url + regsub -all -- {//} $url "/" url if { $package_key ne "" && $url ne "" } { error "set-parameter: Can't specify both package and url for $url and $package_key" Index: openacs-4/packages/acs-tcl/tcl/json-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/json-procs.tcl,v diff -u -N -r1.11.2.1 -r1.11.2.2 --- openacs-4/packages/acs-tcl/tcl/json-procs.tcl 13 Jul 2020 12:02:33 -0000 1.11.2.1 +++ openacs-4/packages/acs-tcl/tcl/json-procs.tcl 1 Feb 2021 10:51:09 -0000 1.11.2.2 @@ -371,10 +371,10 @@ set value "\"$value\"" } # Cleanup linebreaks - regsub -all {\r\n} $value "\n" value - regsub -all {\r} $value "\n" value + regsub -all -- {\r\n} $value "\n" value + regsub -all -- {\r} $value "\n" value # JSON requires new line characters be escaped - regsub -all {\n} $value "\\n" value + regsub -all -- {\n} $value "\\n" value return $value } } Index: openacs-4/packages/acs-tcl/tcl/request-processor-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/request-processor-procs.tcl,v diff -u -N -r1.153.2.29 -r1.153.2.30 --- openacs-4/packages/acs-tcl/tcl/request-processor-procs.tcl 5 Jan 2021 17:10:17 -0000 1.153.2.29 +++ openacs-4/packages/acs-tcl/tcl/request-processor-procs.tcl 1 Feb 2021 10:51:09 -0000 1.153.2.30 @@ -1372,7 +1372,7 @@ # Sub out funky characters in the pathname, so the user can't request # http://www.arsdigita.com/*/index (causing a potentially expensive glob # and bypassing registered procedures)! - regsub -all {[^0-9a-zA-Z_/:.]} $path {\\&} path_glob + regsub -all -- {[^0-9a-zA-Z_/:.]} $path {\\&} path_glob # Grab a list of all available files with extensions. set files [glob -nocomplain "$path_glob$extension_pattern"] Index: openacs-4/packages/acs-tcl/tcl/stack-trace-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/stack-trace-procs.tcl,v diff -u -N -r1.4 -r1.4.2.1 --- openacs-4/packages/acs-tcl/tcl/stack-trace-procs.tcl 7 Aug 2017 23:48:00 -0000 1.4 +++ openacs-4/packages/acs-tcl/tcl/stack-trace-procs.tcl 1 Feb 2021 10:51:09 -0000 1.4.2.1 @@ -31,7 +31,7 @@ if {[string length $call] > 160} { set call "[string range $call 0 150]..." } - regsub -all {\n} $call {\\n} call + regsub -all -- {\n} $call {\\n} call lappend callStack " $call" if {$i > 1} { lappend callStack "invoked from within" Index: openacs-4/packages/acs-tcl/tcl/tcltrace-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/tcltrace-procs.tcl,v diff -u -N -r1.4.2.5 -r1.4.2.6 --- openacs-4/packages/acs-tcl/tcl/tcltrace-procs.tcl 20 Aug 2020 05:22:28 -0000 1.4.2.5 +++ openacs-4/packages/acs-tcl/tcl/tcltrace-procs.tcl 1 Feb 2021 10:51:09 -0000 1.4.2.6 @@ -66,7 +66,7 @@ if {$severity in $::__log_severities} { # we do not want i18n raw strings substituted via ds_comment. # Maybe we should add this substitution there.... - regsub -all {\#([a-zA-Z0-9._-]+)\#} $msg {\#\1\#} msg + regsub -all -- {\#([a-zA-Z0-9._-]+)\#} $msg {\#\1\#} msg catch {ds_comment "$cmdname $severity $msg"} } else { #catch {ds_comment "ignore $severity $msg"} Index: openacs-4/packages/acs-tcl/tcl/text-html-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/text-html-procs.tcl,v diff -u -N -r1.109.2.18 -r1.109.2.19 --- openacs-4/packages/acs-tcl/tcl/text-html-procs.tcl 28 Oct 2020 15:39:19 -0000 1.109.2.18 +++ openacs-4/packages/acs-tcl/tcl/text-html-procs.tcl 1 Feb 2021 10:51:09 -0000 1.109.2.19 @@ -186,25 +186,25 @@ if { !$no_quote_p } { # Convert every two spaces to an nbsp - regsub -all { } $text "\\\  " text + regsub -all -- { } $text "\\\  " text # Convert tabs to four nbsp's - regsub -all {\t} $text {\ \ \ \ } text + regsub -all -- {\t} $text {\ \ \ \ } text } if { $nr_links > 0} { # # Move the end of the link before any punctuation marks at the # end of the URL. # - regsub -all {([\]!?.:;,<>\(\)\}\"'-]+)(\u0003)} $text {\2\1} text + regsub -all -- {([\]!?.:;,<>\(\)\}\"'-]+)(\u0003)} $text {\2\1} text # # Convert the marked links and emails into "..." # - regsub -all {\u0002([^\u0003]+?)\u0003} $text {\1} text + regsub -all -- {\u0002([^\u0003]+?)\u0003} $text {\1} text - set changed_back [regsub -all {(\u0002|\u0003)} $text {} text] + set changed_back [regsub -all -- {(\u0002|\u0003)} $text {} text] if {$includes_html_p} { # # All markers should be gone now. @@ -270,7 +270,7 @@ # if {[info exists path]} { set path "[string trim $path /]/" - regsub -all {(href|src)\s*=\s*['\"]([^/][^\u0001:'\"]+?)['\"]} $html \ + regsub -all -- {(href|src)\s*=\s*['\"]([^/][^\u0001:'\"]+?)['\"]} $html \ "\\1='${location}${path}\\2'" html } @@ -300,14 +300,14 @@ regsub {[\s]+$} $text {} text # Make sure all line breaks are single \n's - regsub -all {\r\n} $text "\n" text - regsub -all {\r} $text "\n" text + regsub -all -- {\r\n} $text "\n" text + regsub -all -- {\r} $text "\n" text # Remove whitespace before \n's - regsub -all {[ \t]+\n} $text "\n" text + regsub -all -- {[ \t]+\n} $text "\n" text # Wrap P's around paragraphs - regsub -all {([^\n\s])\n\n+([^\n\s])} $text {\1

\2} text + regsub -all -- {([^\n\s])\n\n+([^\n\s])} $text {\1

\2} text # remove line breaks right before and after HTML tags that will insert a paragraph break themselves if { $includes_html_p } { @@ -316,10 +316,10 @@ } # Convert _single_ CRLF's to
's to preserve line breaks - regsub -all {\n} $text "
\n" text + regsub -all -- {\n} $text "
\n" text # Add line breaks to P tags - #regsub -all {

} $text "

\n" text + #regsub -all -- {

} $text "

\n" text return $text } @@ -529,7 +529,7 @@ # First try to fix up < not part of a tag. - regsub -all {<([^/[:alpha:]!])} $frag {\<\1} frag + regsub -all -- {<([^/[:alpha:]!])} $frag {\<\1} frag # no we do is chop off any trailing unclosed tag # since when we substr blobs this sometimes happens @@ -1434,14 +1434,14 @@ string map [list \n \\n \b \\b \f \\f \r \\r \t \\t \v \\v \" {\"} ' {\'}] $string # Escape quotes and backslashes (non greedy) - #regsub -all {.??([^\\])?('|\"|\\)} $string {\1\\\2} string + #regsub -all -- {.??([^\\])?('|\"|\\)} $string {\1\\\2} string # Escape characters are replaced with their escape sequence - #regsub -all {\b} $string {\\b} string - #regsub -all {\f} $string {\\f} string - #regsub -all {\n} $string {\\n} string - #regsub -all {\r} $string {\\r} string - #regsub -all {\t} $string {\\t} string - #regsub -all {\v} $string {\\v} string + #regsub -all -- {\b} $string {\\b} string + #regsub -all -- {\f} $string {\\f} string + #regsub -all -- {\n} $string {\\n} string + #regsub -all -- {\r} $string {\\r} string + #regsub -all -- {\t} $string {\\t} string + #regsub -all -- {\v} $string {\\v} string #return $string } @@ -1787,7 +1787,7 @@ # If we're not in a PRE if { $output(pre) <= 0 } { # collapse all whitespace - regsub -all {\s+} $text { } text + regsub -all -- {\s+} $text { } text # if there's only spaces in the string, wait until later if {$text eq " "} { @@ -1807,10 +1807,10 @@ } } else { # we're in a PRE: clean line breaks and tabs - regsub -all {\r\n} $text "\n" text - regsub -all {\r} $text "\n" text + regsub -all -- {\r\n} $text "\n" text + regsub -all -- {\r} $text "\n" text # tabs become four spaces - regsub -all {[\v\t]} $text { } text + regsub -all -- {[\v\t]} $text { } text } # output any pending paragraph breaks, line breaks or spaces. @@ -1853,7 +1853,7 @@ # convert  's # We do this now, so that they're displayed, but not treated, whitespace. - regsub -all { } $word { } word + regsub -all -- { } $word { } word set wordlen [string length $word] switch -glob -- $word { @@ -1920,14 +1920,14 @@ consider how they interact with character encodings. } { - regsub -all {<} $html {<} html - regsub -all {>} $html {>} html - regsub -all {"} $html "\"" html - regsub -all {—} $html {--} html - regsub -all {—} $html {--} html + regsub -all -- {<} $html {<} html + regsub -all -- {>} $html {>} html + regsub -all -- {"} $html "\"" html + regsub -all -- {—} $html {--} html + regsub -all -- {—} $html {--} html # Need to do the & last, because otherwise it could interfere with the other expansions, # e.g., if the text said &lt;, that would be translated into <, instead of < - regsub -all {&} $html {\&} html + regsub -all -- {&} $html {\&} html return $html } @@ -2444,7 +2444,7 @@ ad_proc util_remove_html_tags { html } { Removes everything between < and > from the string. } { - regsub -all {<[^>]*>} $html {} html + regsub -all -- {<[^>]*>} $html {} html return $html } Index: openacs-4/packages/acs-tcl/tcl/utilities-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/utilities-procs.tcl,v diff -u -N -r1.189.2.75 -r1.189.2.76 --- openacs-4/packages/acs-tcl/tcl/utilities-procs.tcl 29 Jan 2021 15:40:05 -0000 1.189.2.75 +++ openacs-4/packages/acs-tcl/tcl/utilities-procs.tcl 1 Feb 2021 10:51:09 -0000 1.189.2.76 @@ -172,7 +172,7 @@ return "" } else { set tentative_path [nsv_get proc_source_file $proc_name] - regsub -all {/\./} $tentative_path {/} result + regsub -all -- {/\./} $tentative_path {/} result return $result } } @@ -185,7 +185,7 @@ private Tcl library files contain errors. } { set tentative_path [info script] - regsub -all {/\./} $tentative_path {/} scrubbed_path + regsub -all -- {/\./} $tentative_path {/} scrubbed_path if { $extra_message eq "" } { set message "Loading $scrubbed_path" } else { @@ -587,12 +587,12 @@ if { $precedence_type ne "noprocessing_vars" } { # Hide escaped colons for below split - regsub -all {\\:} $var_spec "!!cOlOn!!" var_spec + regsub -all -- {\\:} $var_spec "!!cOlOn!!" var_spec set name_spec [split [lindex $var_spec 0] ":"] # Replace escaped colons with single colon - regsub -all {!!cOlOn!!} $name_spec ":" name_spec + regsub -all -- {!!cOlOn!!} $name_spec ":" name_spec set name [lindex $name_spec 0] } else { @@ -971,7 +971,7 @@ files contain errors. } { set tentative_path [info script] - regsub -all {/\./} $tentative_path {/} scrubbed_path + regsub -all -- {/\./} $tentative_path {/} scrubbed_path if { $extra_message eq "" } { set message "Done... $scrubbed_path" } else { @@ -1302,8 +1302,8 @@ same as ns_urlencode except that dash and underscore are left unencoded. } { set encoded_string [ns_urlencode $string] - regsub -all {%2d} $encoded_string {-} encoded_string - regsub -all {%5f} $encoded_string {_} ad_encoded_string + regsub -all -- {%2d} $encoded_string {-} encoded_string + regsub -all -- {%5f} $encoded_string {_} ad_encoded_string return $ad_encoded_string } @@ -1610,7 +1610,7 @@ } # Sanitize URL to avoid potential injection attack - regsub -all {[\r\n]} $url "" url + regsub -all -- {[\r\n]} $url "" url ns_returnredirect $url } @@ -2389,7 +2389,7 @@ set line_length 0 set line_number 0 foreach item $items { - regsub -all {<[^>]+>} $item "" item_notags + regsub -all -- {<[^>]+>} $item "" item_notags if { $line_length > $indent } { if { $line_length + 1 + [string length $item_notags] > $length } { append out "$eol\n" @@ -2442,18 +2442,18 @@ # # Remove Control characters (0x00–0x1f and 0x80–0x9f) # and reserved characters (/, ?, <, >, \, :, *, |, ; and ") - regsub -all {[\u0000-\u001f|/|?|<|>|\\:*|\"|;]+} $str "" str + regsub -all -- {[\u0000-\u001f|/|?|<|>|\\:*|\"|;]+} $str "" str # allow a custom replacement char, that must be safe. - regsub -all {[\u0000-\u001f|/|?|<|>|\\:*|\"|;|\.]+} $replace_with "" replace_with + regsub -all -- {[\u0000-\u001f|/|?|<|>|\\:*|\"|;|\.]+} $replace_with "" replace_with if {$replace_with eq ""} {error "-replace_with must be a safe filesystem character"} # dots other than in file extension are dangerous. Put inside two # '#' character will be seen as message keys and file-storage is # currently set to interpret them. set str_ext [ad_file extension $str] set str_noext [string range $str 0 end-[string length $str_ext]] - regsub -all {\.} $str_noext $replace_with str_noext + regsub -all -- {\.} $str_noext $replace_with str_noext set str ${str_noext}${str_ext} # @@ -2483,7 +2483,7 @@ # # replace all consecutive spaces by a single char # - regsub -all {[ ]+} $str $replace_with str + regsub -all -- {[ ]+} $str $replace_with str } if {$tolower_p} { # @@ -2575,7 +2575,7 @@ set text [string map { \xe6 ae \xf8 oe \xe5 aa \xC6 Ae \xd8 Oe \xc5 Aa } $text] # substitute all non-word characters - regsub -all {([^a-z0-9])+} $text $replacement text + regsub -all -- {([^a-z0-9])+} $text $replacement text set text [string trim $text $replacement] @@ -3043,8 +3043,8 @@ } { Transforms a pretty name to a reasonable pathname. } { - regsub -all -nocase { } [string trim [string tolower $name]] {-} name - regsub -all {[^[:alnum:]\-]} $name {} name + regsub -all -nocase -- { } [string trim [string tolower $name]] {-} name + regsub -all -- {[^[:alnum:]\-]} $name {} name return $name } @@ -3088,9 +3088,9 @@ ad_proc -public util::subst_safe { string } { Make string safe for subst'ing. } { - regsub -all {\$} $string {\$} string - regsub -all {\[} $string {\[} string - regsub -all {\]} $string {\]} string + regsub -all -- {\$} $string {\$} string + regsub -all -- {\[} $string {\[} string + regsub -all -- {\]} $string {\]} string return $string } @@ -3838,11 +3838,11 @@ # # Handle array syntax: # - regsub -all {\$([0-9a-zA-Z_:]*[\(][^\)]+[\)])} $escaped {[ns_quotehtml [set \1]]} escaped + regsub -all -- {\$([0-9a-zA-Z_:]*[\(][^\)]+[\)])} $escaped {[ns_quotehtml [set \1]]} escaped # # Handle plain variables: # - regsub -all {\$([0-9a-zA-Z_:]+|[\{][^\}]+[\}])} $escaped {[ns_quotehtml $\1]} result + regsub -all -- {\$([0-9a-zA-Z_:]+|[\{][^\}]+[\}])} $escaped {[ns_quotehtml $\1]} result # # Finallly, "subst" the result. # @@ -4106,7 +4106,7 @@ # Remove potentially stale gzip file. # if {[ad_file exists $local_path/$file.gz]} { - file delete $local_path/$file.gz + file delete -- $local_path/$file.gz } # Index: openacs-4/packages/acs-tcl/tcl/xml-0-sgml-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/xml-0-sgml-procs.tcl,v diff -u -N -r1.10.2.5 -r1.10.2.6 --- openacs-4/packages/acs-tcl/tcl/xml-0-sgml-procs.tcl 27 Sep 2020 18:10:28 -0000 1.10.2.5 +++ openacs-4/packages/acs-tcl/tcl/xml-0-sgml-procs.tcl 1 Feb 2021 10:51:09 -0000 1.10.2.6 @@ -128,17 +128,17 @@ } # Protect Tcl special characters - regsub -all {([{}\\])} $sgml {\\\1} sgml + regsub -all -- {([{}\\])} $sgml {\\\1} sgml # Do the translation if {[info exists options(-statevariable)]} { upvar #0 $opts(-statevariable) unused if {[info exists unused]} { - regsub -all $elemExpr $unused$sgml $elemSub sgml + regsub -all -- $elemExpr $unused$sgml $elemSub sgml unset unused } else { - regsub -all $elemExpr $sgml $elemSub sgml + regsub -all -- $elemExpr $sgml $elemSub sgml } set sgml "{} {} {} \{$sgml\}" @@ -154,7 +154,7 @@ # Performance note (Tcl 8.0): # In this case, no conversion to list object is performed - regsub -all $elemExpr $sgml $elemSub sgml + regsub -all -- $elemExpr $sgml $elemSub sgml set sgml "{} {} {} \{$sgml\}" } @@ -546,14 +546,14 @@ } { # protect Tcl specials - regsub -all {([][$\\])} $text {\\\1} text + regsub -all -- {([][$\\])} $text {\\\1} text # Mark entity references - regsub -all {&([^;]+);} $text [format {%s; %s {\1} ; %s %s} \}\} [namespace code [list Entity options $options(-entityreferencecommand) $options(-characterdatacommand) $options(-entityvariable)]] [list uplevel #0 $options(-characterdatacommand)] \{\{] text + regsub -all -- {&([^;]+);} $text [format {%s; %s {\1} ; %s %s} \}\} [namespace code [list Entity options $options(-entityreferencecommand) $options(-characterdatacommand) $options(-entityvariable)]] [list uplevel #0 $options(-characterdatacommand)] \{\{] text set text "uplevel #0 $options(-characterdatacommand) {{$text}}" eval $text } else { # Restore protected special characters - regsub -all {\\([{}\\])} $text {\1} text + regsub -all -- {\\([{}\\])} $text {\1} text uplevel #0 $options(-characterdatacommand) [list $text] } } elseif {[string length [string trim $text]]} { @@ -851,7 +851,7 @@ set exp ]+)[cl $Wsp]*([cl ^$Wsp]+)[cl $Wsp]*([cl ^>]*)> set sub {{\1} {\2} {\3} } - regsub -all $exp $dtd $sub dtd + regsub -all -- $exp $dtd $sub dtd foreach {decl id value} $dtd { catch {DTD:[string toupper $decl] $id $value} err @@ -986,9 +986,9 @@ return -code error "illegal characters in specification" } - regsub -all [format {(%s)[%s]*(\?|\*|\+)?[%s]*(,|\|)?} $name $Wsp $Wsp] $spec [format {%sCModelSTname %s {\1} {\2} {\3}} \n $state] spec - regsub -all {\(} $spec "\nCModelSTopenParen $state " spec - regsub -all [format {\)[%s]*(\?|\*|\+)?[%s]*(,|\|)?} $Wsp $Wsp] $spec [format {%sCModelSTcloseParen %s {\1} {\2}} \n $state] spec + regsub -all -- [format {(%s)[%s]*(\?|\*|\+)?[%s]*(,|\|)?} $name $Wsp $Wsp] $spec [format {%sCModelSTname %s {\1} {\2} {\3}} \n $state] spec + regsub -all -- {\(} $spec "\nCModelSTopenParen $state " spec + regsub -all -- [format {\)[%s]*(\?|\*|\+)?[%s]*(,|\|)?} $Wsp $Wsp] $spec [format {%sCModelSTcloseParen %s {\1} {\2}} \n $state] spec array set var {stack {} state start} eval $spec @@ -1540,10 +1540,10 @@ } else { # Parse the attribute list. If it were regular, could just use foreach, # but some attributes may have values. - regsub -all {([][$\\])} $value {\\\1} value - regsub -all $attlist_exp $value {[DTDAttribute {\1} {\2} {\3}]} value - regsub -all $attlist_enum_exp $value {[DTDAttribute {\1} {\2} {\3}]} value - regsub -all $attlist_fixed_exp $value {[DTDAttribute {\1} {\2} {\3} {\4}]} value + regsub -all -- {([][$\\])} $value {\\\1} value + regsub -all -- $attlist_exp $value {[DTDAttribute {\1} {\2} {\3}]} value + regsub -all -- $attlist_enum_exp $value {[DTDAttribute {\1} {\2} {\3}]} value + regsub -all -- $attlist_fixed_exp $value {[DTDAttribute {\1} {\2} {\3} {\4}]} value subst $value set am($id) [array get attlist] } @@ -1677,7 +1677,7 @@ # As above proc sgml::zapWhite data { - regsub -all "\[ \t\r\n\]+" $data { } data + regsub -all -- "\[ \t\r\n\]+" $data { } data return $data } Index: openacs-4/packages/acs-tcl/tcl/xml-1-dom-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/xml-1-dom-procs.tcl,v diff -u -N -r1.11.2.2 -r1.11.2.3 --- openacs-4/packages/acs-tcl/tcl/xml-1-dom-procs.tcl 5 Jan 2021 17:10:17 -0000 1.11.2.2 +++ openacs-4/packages/acs-tcl/tcl/xml-1-dom-procs.tcl 1 Feb 2021 10:51:09 -0000 1.11.2.3 @@ -1723,7 +1723,7 @@ ' ' } - regsub -all {([$<>&"'])} $value {$Entity(\1)} value + regsub -all -- {([$<>&"'])} $value {$Entity(\1)} value return [subst -nocommand -nobackslash $value] } Index: openacs-4/packages/acs-tcl/tcl/xml-2-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/xml-2-procs.tcl,v diff -u -N -r1.5.2.2 -r1.5.2.3 --- openacs-4/packages/acs-tcl/tcl/xml-2-procs.tcl 28 Oct 2020 15:39:19 -0000 1.5.2.2 +++ openacs-4/packages/acs-tcl/tcl/xml-2-procs.tcl 1 Feb 2021 10:51:09 -0000 1.5.2.3 @@ -330,7 +330,7 @@ # As above proc xml::zapWhite data { - regsub -all "\[ \t\r\n\]+" $data { } data + regsub -all -- "\[ \t\r\n\]+" $data { } data return $data } Index: openacs-4/packages/acs-tcl/tcl/test/doc-check-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/test/doc-check-procs.tcl,v diff -u -N -r1.20.2.12 -r1.20.2.13 --- openacs-4/packages/acs-tcl/tcl/test/doc-check-procs.tcl 16 Dec 2020 17:14:27 -0000 1.20.2.12 +++ openacs-4/packages/acs-tcl/tcl/test/doc-check-procs.tcl 1 Feb 2021 10:51:09 -0000 1.20.2.13 @@ -52,7 +52,7 @@ ns_log notice "$p" incr count set tail [namespace tail $p] - set qualifiers [regsub -all "::" [namespace qualifiers $p] "__"] + set qualifiers [regsub -all -- "::" [namespace qualifiers $p] "__"] if {[regexp $internalUse $p] || [regexp $serverModuleProcs $p] || [regexp $functionalOps $p] || [regexp $xmlRPC $p]} continue set pa [nsv_get api_proc_doc $p] set protection [expr {[dict exists $pa protection] && "public" in [dict get $pa protection] Index: openacs-4/packages/acs-tcl/tcl/test/http-client-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/test/Attic/http-client-procs.tcl,v diff -u -N -r1.1.2.13 -r1.1.2.14 --- openacs-4/packages/acs-tcl/tcl/test/http-client-procs.tcl 13 Jan 2021 11:00:18 -0000 1.1.2.13 +++ openacs-4/packages/acs-tcl/tcl/test/http-client-procs.tcl 1 Feb 2021 10:51:09 -0000 1.1.2.14 @@ -125,7 +125,7 @@ close $rfd aa_true "Setting the charset actually brings to different content in the response" {$app_json_text ne $iso8859_2_text} - file delete $tmpfile_app_json $tmpfile_iso8859_2 + file delete -- $tmpfile_app_json $tmpfile_iso8859_2 } } } Index: openacs-4/packages/acs-templating/tcl/acs-integration-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/tcl/acs-integration-procs.tcl,v diff -u -N -r1.27.2.4 -r1.27.2.5 --- openacs-4/packages/acs-templating/tcl/acs-integration-procs.tcl 3 Jul 2020 07:27:29 -0000 1.27.2.4 +++ openacs-4/packages/acs-templating/tcl/acs-integration-procs.tcl 1 Feb 2021 10:54:23 -0000 1.27.2.5 @@ -137,12 +137,12 @@ set apm_package_url [apm_package_url_from_key "acs-lang"] # Attempt to move all message keys outside of tags - while { [regsub -all {(<[^>]*)(\x02\(\x01[^\x01]*\x01\)\x02)([^>]*>)} $parsed_template {\2\1\3} parsed_template] } {} + while { [regsub -all -- {(<[^>]*)(\x02\(\x01[^\x01]*\x01\)\x02)([^>]*>)} $parsed_template {\2\1\3} parsed_template] } {} # Attempt to move all message keys outside of statements - regsub -all -nocase {(]*>[^<]*)(\x02\(\x01[^\x01]*\x01\)\x02)([^<]*]*>)} $parsed_template {\2\1\3} parsed_template + regsub -all -nocase -- {(]*>[^<]*)(\x02\(\x01[^\x01]*\x01\)\x02)([^<]*]*>)} $parsed_template {\2\1\3} parsed_template - while { [regsub -all -nocase {(]*>[^<]*)(\x02\(\x01[^\x01]*\x01\)\x02)} $parsed_template {\2\1} parsed_template] } {} + while { [regsub -all -nocase -- {(]*>[^<]*)(\x02\(\x01[^\x01]*\x01\)\x02)} $parsed_template {\2\1} parsed_template] } {} set start 0 while { [regexp -nocase -indices -start $start {(:() - regsub -all "($name).($column_name)" $running_code "$name:${i}($column_name)" running_code + regsub -all -- "($name).($column_name)" $running_code "$name:${i}($column_name)" running_code } - regsub -all {@([a-zA-Z0-9_:\(\)]+)@} $running_code {${\1}} running_code + regsub -all -- {@([a-zA-Z0-9_:\(\)]+)@} $running_code {${\1}} running_code uplevel { eval $running_code Index: openacs-4/packages/acs-templating/tcl/doc-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/tcl/doc-procs.tcl,v diff -u -N -r1.11 -r1.11.2.1 --- openacs-4/packages/acs-templating/tcl/doc-procs.tcl 9 May 2018 15:33:29 -0000 1.11 +++ openacs-4/packages/acs-templating/tcl/doc-procs.tcl 1 Feb 2021 10:54:23 -0000 1.11.2.1 @@ -28,10 +28,10 @@ } { # remove carriage returns if present - regsub -all {\r|\r\n} $code {\n} code + regsub -all -- {\r|\r\n} $code {\n} code # remove extra blank lines - regsub -all {(\n)\n} $code {\1} code + regsub -all -- {(\n)\n} $code {\1} code set lines [split $code "\n"] Index: openacs-4/packages/acs-templating/tcl/doc-tcl-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/tcl/doc-tcl-procs.tcl,v diff -u -N -r1.20.2.2 -r1.20.2.3 --- openacs-4/packages/acs-templating/tcl/doc-tcl-procs.tcl 16 Nov 2019 16:03:41 -0000 1.20.2.2 +++ openacs-4/packages/acs-templating/tcl/doc-tcl-procs.tcl 1 Feb 2021 10:54:23 -0000 1.20.2.3 @@ -20,7 +20,7 @@ ad_proc -private doc::util::dbl_colon_fix { text } { - regsub -all {::} $text {__} text + regsub -all -- {::} $text {__} text return $text } @@ -172,25 +172,25 @@ @return same text but with a space behind each quote; double quotes that are already trailed by a space are unaffected } { - regsub -all {"} $text {" } text - regsub -all {" } $text {" } text + regsub -all -- {"} $text {" } text + regsub -all -- {" } $text {" } text return $text } ad_proc -private doc::util::bracket_space {text} { puts a space after all closing curly brackets, does not add a space when brackets are already followed by a space } { - regsub -all {(\})} $text {\1 } text - regsub -all {(\}) } $text {\1 } text + regsub -all -- {(\})} $text {\1 } text + regsub -all -- {(\}) } $text {\1 } text return $text } ad_proc -private doc::util::escape_square_brackets {text} { escapes out all square brackets } { - regsub -all {(\[)} $text {\\\1} text - regsub -all {(\])} $text {\\\1} text + regsub -all -- {(\[)} $text {\\\1} text + regsub -all -- {(\])} $text {\\\1} text return $text } @@ -210,7 +210,7 @@ @return text } { regsub -all \" $text {\"} text - regsub -all {(\n)\s*#\s*} $text {\1 } text + regsub -all -- {(\n)\s*#\s*} $text {\1 } text regsub {(\A)\s*#\s*} $text {\1 } text return $text } Index: openacs-4/packages/acs-templating/tcl/file-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/tcl/file-procs.tcl,v diff -u -N -r1.12.2.3 -r1.12.2.4 --- openacs-4/packages/acs-templating/tcl/file-procs.tcl 9 Jul 2019 17:01:57 -0000 1.12.2.3 +++ openacs-4/packages/acs-templating/tcl/file-procs.tcl 1 Feb 2021 10:54:23 -0000 1.12.2.4 @@ -70,8 +70,8 @@ # # Cleanup filenames # - regsub -all {\\+} $filename {/} filename - regsub -all { +} $filename {_} filename + regsub -all -- {\\+} $filename {/} filename + regsub -all -- { +} $filename {_} filename set filename [lindex [split $filename "/"] end] # # Append to the list of lists Index: openacs-4/packages/acs-templating/tcl/form-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/tcl/form-procs.tcl,v diff -u -N -r1.59.2.2 -r1.59.2.3 --- openacs-4/packages/acs-templating/tcl/form-procs.tcl 11 Dec 2019 17:10:17 -0000 1.59.2.2 +++ openacs-4/packages/acs-templating/tcl/form-procs.tcl 1 Feb 2021 10:54:23 -0000 1.59.2.3 @@ -177,7 +177,7 @@ if { [info exists opts(elements)] } { # strip carriage returns - regsub -all {\r} $opts(elements) {} element_data + regsub -all -- {\r} $opts(elements) {} element_data foreach element [split $element_data "\n"] { set element [string trim $element] Index: openacs-4/packages/acs-templating/tcl/list-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/tcl/list-procs.tcl,v diff -u -N -r1.94.2.9 -r1.94.2.10 --- openacs-4/packages/acs-templating/tcl/list-procs.tcl 3 Jul 2020 07:27:29 -0000 1.94.2.9 +++ openacs-4/packages/acs-templating/tcl/list-procs.tcl 1 Feb 2021 10:54:23 -0000 1.94.2.10 @@ -897,7 +897,7 @@ } { Quote a string for inclusion as a csv element } { - regsub -all {\"} $string {""} result + regsub -all -- {\"} $string {""} result return $result } Index: openacs-4/packages/acs-templating/tcl/parse-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/tcl/parse-procs.tcl,v diff -u -N -r1.65.2.7 -r1.65.2.8 --- openacs-4/packages/acs-templating/tcl/parse-procs.tcl 28 Oct 2020 15:39:19 -0000 1.65.2.7 +++ openacs-4/packages/acs-templating/tcl/parse-procs.tcl 1 Feb 2021 10:54:23 -0000 1.65.2.8 @@ -457,10 +457,10 @@ # array variables # TODO: ns_quotehtml # TODO: lang::util::localize - regsub -all {[\]\[\{\}\"]\\$} $substitution {\\&} substitution + regsub -all -- {[\]\[\{\}\"]\\$} $substitution {\\&} substitution if { [regexp {^%([[:alnum:]_]+)\.([[:alnum:]_]+)%$} $substitution match arr key] } { # the array key name is substitured by the Tcl parser s - regsub -all {[\]\[\{\}\"]\\$} $key {\\&} key + regsub -all -- {[\]\[\{\}\"]\\$} $key {\\&} key set command "set ${arr}(${key})" set substitution [uplevel $command] } @@ -506,9 +506,9 @@ # substitute <% ... %> blocks with registered tags so they can be handled # by our proc rather than evaluated. - regsub -all {<%} $chunk {} chunk + regsub -all -- {<%} $chunk {} chunk # avoid substituting when it is a percentage attribute to an HTML tag. - regsub -all {([^0-9])%>} $chunk {\1} chunk + regsub -all -- {([^0-9])%>} $chunk {\1} chunk # warn about the first ambiguity in the source if {[regexp {[0-9]+%>} $chunk match]} { ns_log warning "ambiguous '$match'; write Tcl escapes with a space like\ @@ -544,23 +544,23 @@ # variable references. # substitute array variable references - while {[regsub -all [template::adp_array_variable_regexp_noquote] $code {\1[lang::util::localize $\2(\3)]} code]} {} - while {[regsub -all [template::adp_array_variable_regexp_noi18n] $code {\1[ns_quotehtml $\2(\3)]} code]} {} - while {[regsub -all [template::adp_array_variable_regexp_literal] $code {\1$\2(\3)} code]} {} + while {[regsub -all -- [template::adp_array_variable_regexp_noquote] $code {\1[lang::util::localize $\2(\3)]} code]} {} + while {[regsub -all -- [template::adp_array_variable_regexp_noi18n] $code {\1[ns_quotehtml $\2(\3)]} code]} {} + while {[regsub -all -- [template::adp_array_variable_regexp_literal] $code {\1$\2(\3)} code]} {} # # Some aolservers have broken implementations of ns_quotehtml # (returning for the empty string input a one byte output). # - while {[regsub -all [template::adp_array_variable_regexp] $code {\1[ns_quotehtml [lang::util::localize $\2(\3)]]} code]} {} + while {[regsub -all -- [template::adp_array_variable_regexp] $code {\1[ns_quotehtml [lang::util::localize $\2(\3)]]} code]} {} # substitute simple variable references - while {[regsub -all [template::adp_variable_regexp_noquote] $code {\1[lang::util::localize ${\2}]} code]} {} - while {[regsub -all [template::adp_variable_regexp_noi18n] $code {\1[ns_quotehtml ${\2}]} code]} {} - while {[regsub -all [template::adp_variable_regexp_literal] $code {\1${\2}} code]} {} + while {[regsub -all -- [template::adp_variable_regexp_noquote] $code {\1[lang::util::localize ${\2}]} code]} {} + while {[regsub -all -- [template::adp_variable_regexp_noi18n] $code {\1[ns_quotehtml ${\2}]} code]} {} + while {[regsub -all -- [template::adp_variable_regexp_literal] $code {\1${\2}} code]} {} if {[ns_quotehtml ""] eq ""} { - while {[regsub -all [template::adp_variable_regexp] $code {\1[ns_quotehtml [lang::util::localize ${\2}]]} code]} {} + while {[regsub -all -- [template::adp_variable_regexp] $code {\1[ns_quotehtml [lang::util::localize ${\2}]]} code]} {} } else { - while {[regsub -all [template::adp_variable_regexp] $code {\1[ns_quotehtml [lang::util::localize ${\2}]]} code]} {} + while {[regsub -all -- [template::adp_variable_regexp] $code {\1[ns_quotehtml [lang::util::localize ${\2}]]} code]} {} } # unescape protected # references @@ -690,7 +690,7 @@ } { upvar $chunk_var_name chunk $quoted_var_name quoted - regsub -all {[\]\[\{\}\"\\$]} $chunk {\\&} quoted + regsub -all -- {[\]\[\{\}\"\\$]} $chunk {\\&} quoted } ad_proc -private template::adp_append_string { s } { Index: openacs-4/packages/acs-templating/tcl/request-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/tcl/request-procs.tcl,v diff -u -N -r1.11 -r1.11.2.1 --- openacs-4/packages/acs-templating/tcl/request-procs.tcl 25 Jul 2018 21:17:07 -0000 1.11 +++ openacs-4/packages/acs-templating/tcl/request-procs.tcl 1 Feb 2021 10:54:23 -0000 1.11.2.1 @@ -53,7 +53,7 @@ if { [info exists opts(params)] } { # strip carriage returns - regsub -all {\r} $opts(params) {} param_data + regsub -all -- {\r} $opts(params) {} param_data foreach param [split $param_data "\n"] { Index: openacs-4/packages/acs-templating/tcl/spellcheck-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/tcl/spellcheck-procs.tcl,v diff -u -N -r1.28.2.4 -r1.28.2.5 --- openacs-4/packages/acs-templating/tcl/spellcheck-procs.tcl 17 Jun 2019 10:15:36 -0000 1.28.2.4 +++ openacs-4/packages/acs-templating/tcl/spellcheck-procs.tcl 1 Feb 2021 10:54:23 -0000 1.28.2.5 @@ -184,7 +184,7 @@ # if HTML then substitute out all HTML tags if { $html_p } { - regsub -all {<[^<]*>} $text_to_spell_check "" text_to_spell_check + regsub -all -- {<[^<]*>} $text_to_spell_check "" text_to_spell_check } set tmpfile [ns_mktemp "[ad_tmpdir]/webspellXXXXXX"] @@ -318,7 +318,7 @@ if {"miss" eq $errtype} { regsub "\#$errnum\#" $formtext "" formtext } elseif {"nearmiss" eq $errtype} { - regsub -all ", " $erroptions "," erroptions + regsub -all -- ", " $erroptions "," erroptions set options [split $erroptions ","] set select_text "" Index: openacs-4/packages/acs-templating/tcl/table-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/tcl/table-procs.tcl,v diff -u -N -r1.11.2.1 -r1.11.2.2 --- openacs-4/packages/acs-templating/tcl/table-procs.tcl 17 Dec 2019 17:01:20 -0000 1.11.2.1 +++ openacs-4/packages/acs-templating/tcl/table-procs.tcl 1 Feb 2021 10:54:23 -0000 1.11.2.2 @@ -155,7 +155,7 @@ # Append to the row html if { $presentation ne "" } { # Debug ! - regsub -all {"} $presentation {\\"} presentation + regsub -all -- {"} $presentation {\\"} presentation append eval_code "set row($row_key) \"$presentation\"\n" } else { append eval_code "set row($row_key) \$$column_name\n" Index: openacs-4/packages/acs-templating/tcl/tag-init.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/tcl/tag-init.tcl,v diff -u -N -r1.49.2.5 -r1.49.2.6 --- openacs-4/packages/acs-templating/tcl/tag-init.tcl 28 Oct 2020 15:39:19 -0000 1.49.2.5 +++ openacs-4/packages/acs-templating/tcl/tag-init.tcl 1 Feb 2021 10:54:23 -0000 1.49.2.6 @@ -38,10 +38,10 @@ if {$adp eq ""} {set adp 0} # quote dollar signs, square bracket and quotes - regsub -all {[\]\[\"\\$]} $chunk {\\&} quoted_chunk + regsub -all -- {[\]\[\"\\$]} $chunk {\\&} quoted_chunk if {$adp} { - regsub -all {} $quoted_chunk {<%} quoted_chunk - regsub -all {} $quoted_chunk {%>} quoted_chunk + regsub -all -- {} $quoted_chunk {<%} quoted_chunk + regsub -all -- {} $quoted_chunk {%>} quoted_chunk template::adp_append_code "set __adp_properties($name) \[ns_adp_parse -string \"$quoted_chunk\"\]" } else { @@ -493,7 +493,7 @@ template::tag noparse { chunk params } { # escape quotes - regsub -all {[\]\[""\\$]} $chunk {\\&} quoted + regsub -all -- {[\]\[""\\$]} $chunk {\\&} quoted template::adp_append_string $quoted } @@ -829,7 +829,7 @@ } # quote dollar signs, square bracket and quotes - regsub -all {[\]\[""\\$]} $chunk {\\&} quoted_chunk + regsub -all -- {[\]\[""\\$]} $chunk {\\&} quoted_chunk template::adp_append_code \ [subst -nocommands {append __adp_output [_ $locale $key $quoted_chunk]}] Index: openacs-4/packages/acs-templating/tcl/wizard-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/tcl/wizard-procs.tcl,v diff -u -N -r1.21.2.1 -r1.21.2.2 --- openacs-4/packages/acs-templating/tcl/wizard-procs.tcl 18 Feb 2020 11:53:15 -0000 1.21.2.1 +++ openacs-4/packages/acs-templating/tcl/wizard-procs.tcl 1 Feb 2021 10:54:23 -0000 1.21.2.2 @@ -110,7 +110,7 @@ if { [info exists opts(steps)] } { # strip carriage returns - regsub -all {\r} $opts(steps) {} step_data + regsub -all -- {\r} $opts(steps) {} step_data foreach step [split $step_data "\n"] { Index: openacs-4/packages/acs-templating/www/admin/test/include.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/www/admin/test/include.tcl,v diff -u -N -r1.4.2.1 -r1.4.2.2 --- openacs-4/packages/acs-templating/www/admin/test/include.tcl 2 Jan 2020 12:27:36 -0000 1.4.2.1 +++ openacs-4/packages/acs-templating/www/admin/test/include.tcl 1 Feb 2021 10:54:23 -0000 1.4.2.2 @@ -9,14 +9,14 @@ set car [lindex $l 0] set cdr [lrange $l 1 end] - regsub -all {%([a-zA-Z0-9.:_]+)%} $car {@\1@} condition + regsub -all -- {%([a-zA-Z0-9.:_]+)%} $car {@\1@} condition foreach {name rules} { true {"TRUE " "" FALSE not } false { TRUE not "FALSE " "" and %AND% or and %AND% or} } { # note that this cannot correctly reverse and/or mixes (no grouping) set ${name}_condition $condition foreach {from to} $rules { - regsub -all $from [set ${name}_condition] $to ${name}_condition + regsub -all -- $from [set ${name}_condition] $to ${name}_condition } regsub -all \ {@([^@ ]+@)} [set ${name}_condition] {@<%%>\1} ${name}_label Index: openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/OacsFs/popups/file-selector.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/OacsFs/popups/file-selector.tcl,v diff -u -N -r1.10.2.1 -r1.10.2.2 --- openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/OacsFs/popups/file-selector.tcl 3 Jul 2020 07:27:29 -0000 1.10.2.1 +++ openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/OacsFs/popups/file-selector.tcl 1 Feb 2021 10:54:23 -0000 1.10.2.2 @@ -279,7 +279,7 @@ # We need to encode the hashes in any i18n message keys (.LRN plays # this trick on some of its folders). If we don't, the hashes will cause # the path to be chopped off (by ns_conn url) at the leftmost hash. - regsub -all {\#} $file_url {%23} file_url + regsub -all -- {\#} $file_url {%23} file_url } set HTML_NothingSelected [_ acs-templating.HTMLArea_SelectImageNothingSelected] Index: openacs-4/packages/acs-templating/www/scripts/xinha/attach-file.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/www/scripts/xinha/attach-file.tcl,v diff -u -N -r1.26.2.1 -r1.26.2.2 --- openacs-4/packages/acs-templating/www/scripts/xinha/attach-file.tcl 3 Jul 2020 07:27:29 -0000 1.26.2.1 +++ openacs-4/packages/acs-templating/www/scripts/xinha/attach-file.tcl 1 Feb 2021 10:54:23 -0000 1.26.2.2 @@ -212,7 +212,7 @@ set file_name [lindex $recent_files_options [lsearch -index 1 $recent_files_options $item_id] 0] # we have to get rid of the icon from the form. - set file_name [regsub -all {<.*?>} $file_name {}] + set file_name [regsub -all -- {<.*?>} $file_name {}] } } set file_name [string trim $file_name] Index: openacs-4/packages/acs-templating/www/scripts/xinha/file-selector.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/www/scripts/xinha/file-selector.tcl,v diff -u -N -r1.9.2.1 -r1.9.2.2 --- openacs-4/packages/acs-templating/www/scripts/xinha/file-selector.tcl 3 Jul 2020 07:27:29 -0000 1.9.2.1 +++ openacs-4/packages/acs-templating/www/scripts/xinha/file-selector.tcl 1 Feb 2021 10:54:23 -0000 1.9.2.2 @@ -255,7 +255,7 @@ # We need to encode the hashes in any i18n message keys (.LRN plays # this trick on some of its folders). If we don't, the hashes will cause # the path to be chopped off (by ns_conn url) at the leftmost hash. - regsub -all {\#} $file_url {%23} file_url + regsub -all -- {\#} $file_url {%23} file_url } set HTML_NothingSelected [_ acs-templating.HTMLArea_SelectImageNothingSelected] Index: openacs-4/packages/acs-mail-lite/tcl/acs-mail-lite-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-mail-lite/tcl/acs-mail-lite-procs.tcl,v diff -u -N -r1.108.2.14 -r1.108.2.15 --- openacs-4/packages/acs-mail-lite/tcl/acs-mail-lite-procs.tcl 15 Dec 2020 11:08:34 -0000 1.108.2.14 +++ openacs-4/packages/acs-mail-lite/tcl/acs-mail-lite-procs.tcl 1 Feb 2021 10:55:56 -0000 1.108.2.15 @@ -909,7 +909,7 @@ @return the interpolated string } { foreach pair $values { - regsub -all [lindex $pair 0] $text [lindex $pair 1] text + regsub -all -- [lindex $pair 0] $text [lindex $pair 1] text } return $text } Index: openacs-4/packages/acs-mail-lite/tcl/utils-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-mail-lite/tcl/utils-procs.tcl,v diff -u -N -r1.9 -r1.9.2.1 --- openacs-4/packages/acs-mail-lite/tcl/utils-procs.tcl 15 Aug 2018 16:24:28 -0000 1.9 +++ openacs-4/packages/acs-mail-lite/tcl/utils-procs.tcl 1 Feb 2021 10:55:56 -0000 1.9.2.1 @@ -42,7 +42,7 @@ # set subject [string trim $subject] - if {[regsub -all {[\r\n]} $subject " " s]} { + if {[regsub -all -- {[\r\n]} $subject " " s]} { ad_log warning "subject line contains line breaks (replaced by space): '$subject' -> '$s'" set subject $s } Index: openacs-4/packages/acs-admin/tcl/test/acs-admin-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-admin/tcl/test/acs-admin-procs.tcl,v diff -u -N -r1.6.2.6 -r1.6.2.7 --- openacs-4/packages/acs-admin/tcl/test/acs-admin-procs.tcl 24 Jul 2020 12:36:20 -0000 1.6.2.6 +++ openacs-4/packages/acs-admin/tcl/test/acs-admin-procs.tcl 1 Feb 2021 10:56:39 -0000 1.6.2.7 @@ -111,7 +111,7 @@ set portrait_id [acs_user::create_portrait \ -user_id $user_id_1 \ -file $tmpnam] - file delete $tmpnam + file delete -- $tmpnam # Get a random object none of the two users has write # privilege for Index: openacs-4/packages/acs-admin/www/users/user-batch-add-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-admin/www/users/user-batch-add-2.tcl,v diff -u -N -r1.9 -r1.9.2.1 --- openacs-4/packages/acs-admin/www/users/user-batch-add-2.tcl 21 Jan 2018 00:38:38 -0000 1.9 +++ openacs-4/packages/acs-admin/www/users/user-batch-add-2.tcl 1 Feb 2021 10:56:39 -0000 1.9.2.1 @@ -80,7 +80,7 @@ set sub_message $message foreach key $key_list value $value_list { - regsub -all "<$key>" $sub_message $value sub_message + regsub -all -- "<$key>" $sub_message $value sub_message } if {[catch {acs_mail_lite::send -send_immediately -to_addr $email -from_addr $from -subject $subject -body $sub_message} errmsg]} { Index: openacs-4/packages/acs-api-browser/tcl/acs-api-documentation-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-api-browser/tcl/acs-api-documentation-procs.tcl,v diff -u -N -r1.72.2.24 -r1.72.2.25 --- openacs-4/packages/acs-api-browser/tcl/acs-api-documentation-procs.tcl 28 Oct 2020 15:39:18 -0000 1.72.2.24 +++ openacs-4/packages/acs-api-browser/tcl/acs-api-documentation-procs.tcl 1 Feb 2021 10:57:30 -0000 1.72.2.25 @@ -107,7 +107,7 @@ set file [open "$::acs::rootdir/$path" "r"] while { [gets $file line] >= 0 } { # Eliminate any comment characters. - regsub -all {\#.*$} $line "" line + regsub -all -- {\#.*$} $line "" line set line [string trim $line] if { $line ne "" } { set has_contract_p [regexp {(^ad_(page|include)_contract\s)|(Package initialize )} $line] @@ -389,7 +389,7 @@ # if {[string match *::::* $proc_name]} { ad_log warning "api_proc_documentation: received invalid proc_name <$proc_name>, try to sanitize" - regsub -all {::::} $proc_name :: proc_name + regsub -all -- {::::} $proc_name :: proc_name } if {[info exists format]} { ad_log warning "-format flag is deprecated and has no effect" @@ -793,7 +793,7 @@ @param proc_name name is fully qualified name without leading colons proc procs, XOTcl methods are a triple with the fully qualified class name, then proc|instproc and then the method name. - @param property name of property such as "testcase" + @param property name of property such as "main" "testcase" "calledby" "deprecated_p" "script" "protection" @param value value of the property } { @@ -1145,7 +1145,7 @@ # In case the proc_name contains magic chars, these have to be # escaped for Tcl commands expecting a pattern (e.g. "info procs") # - regsub -all {([?*])} $proc_name {\\\1} proc_name_pattern + regsub -all -- {([?*])} $proc_name {\\\1} proc_name_pattern if {[namespace which ::xo::api] ne "" && [regexp {^(.*) (inst)?proc (.*)$} $proc_name match obj prefix method]} { @@ -1205,7 +1205,7 @@ @param see a string expected to contain the resource to format @return the html string representing the resource } { - #regsub -all {proc *} $see {} see + #regsub -all -- {proc *} $see {} see set see [string trim $see] if {[nsv_exists api_proc_doc $see]} { set href [export_vars -base /api-doc/proc-view {{proc $see}}] @@ -1403,7 +1403,7 @@ } { # turn keywords into space-separated things # replace one or more commands with a space - regsub -all {,+} $keywords " " keywords + regsub -all -- {,+} $keywords " " keywords set score 0 foreach word $keywords {