diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2023-03-04 17:32:28 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2023-03-04 17:32:28 (GMT) |
commit | 5a03048c707ee966457a12a6901c488012ecde2c (patch) | |
tree | 7b439865bb5e1fd4405c5676f0dd5789c0afacbf /library/tearoff.tcl | |
parent | 9baa9e4e8d5bc0b13e50aee748da41fc8a0685d7 (diff) | |
parent | 029178e43fc490bd9289e3ac2b2f62ad749ba8fd (diff) | |
download | tk-5a03048c707ee966457a12a6901c488012ecde2c.zip tk-5a03048c707ee966457a12a6901c488012ecde2c.tar.gz tk-5a03048c707ee966457a12a6901c488012ecde2c.tar.bz2 |
Merge 8.6
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 |