diff options
Diffstat (limited to 'library')
-rw-r--r-- | library/tearoff.tcl | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/library/tearoff.tcl b/library/tearoff.tcl index 96e275f..24168cb 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,9 +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 [string range $script 0 $index-1] append x $dst set script [string range $script $index+$eventLen end] } |