This commit is contained in:
radical_honesty on #flashsupport 2023-01-13 15:37:53 -08:00 committed by dupa dup
parent bf91966b98
commit 4edae87313

View File

@ -1,18 +1,18 @@
{s n} {
{s n} {
set c [csplit $s]
if {$n > [expr [llength [lindex $c 0]]-1]} {set n [expr [llength [lindex $c 0]]-1]}
set b 0
set u 0
set u 0
set cf -1
set cb -1
set cb -1
set r ""
foreach f [lindex $c 1] {
if {[lindex $f 0] > $n} {
if {$b eq 1} {append r "\002"}
if {$u eq 1} {append r "\037"}
if {$cf > -1} {append r [format "%s" $cf]}
if {$cf > -1} {append r [format "\002%s" $cf]}
if {$cb > -1} {append r [format ",%s" $cb]}
return $r
return $r
}
if {[lindex $f 1] eq "\002"} {set b [expr $b ^ 1]}
if {[lindex $f 1] eq "\037"} {set u [expr $u ^ 1]}
@ -22,7 +22,7 @@
if {[set m [regexp -inline {([\d]+)$} [lindex $f 1]]] ne ""} {set cf [lindex $m 1]}
if {[set m [regexp -inline {([\d]+),([\d]+)} [lindex $f 1]]] ne ""} {set cf [lindex $m 1];set cb [lindex $m 2]}
}
if {$b eq 1} {append r "\002"}
if {$b eq 1} {append r "\002"}
if {$u eq 1} {append r "\037"}
if {$cf > -1} {append r [format "%s" $cf]}
if {$cb > -1} {append r [format ",%s" $cb]}