diff options
Diffstat (limited to 'library/tearoff.tcl')
-rw-r--r-- | library/tearoff.tcl | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/library/tearoff.tcl b/library/tearoff.tcl index 45f7dcb..3edae7b 100644 --- a/library/tearoff.tcl +++ b/library/tearoff.tcl @@ -154,9 +154,7 @@ proc ::tk::MenuDup {src dst type} { # Copy tags to x, replacing each substring of src with dst. while {[set index [string first $src $tags]] >= 0} { - if {$index > 0} { - append x [string range $tags 0 $index-1]$dst - } + append x [string range $tags 0 $index-1]$dst set tags [string range $tags $index+$srcLen end] } append x $tags @@ -171,10 +169,7 @@ proc ::tk::MenuDup {src dst type} { # Copy script to x, replacing each substring of event with dst. while {[set index [string first $event $script]] >= 0} { - if {$index > 0} { - append x [string range $script 0 $index-1] - } - append x $dst + append x [string range $script 0 $index-1]$dst set script [string range $script $index+$eventLen end] } append x $script |