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 }