Fix package_ip.tcl SplitSub incorrect results with start word containing

delimiter
This commit is contained in:
Madeline Busig 2026-07-15 19:17:27 -07:00
parent 1f1fe1dff0
commit 423761f413

View File

@ -16,7 +16,10 @@ proc DictValueOr { dict key default } {
# EX: [SplitSub buz.bar foo] => ""
proc SplitSub { str startword } {
if { [string first $startword $str] == 0 } {
set sepidx [string first "." "$str"]
# Start searching for the delimiter after the start word, otherwise
# start words containing a delimiter will yield incorrect results
set start_substr_idx [string length $startword]
set sepidx [string first "." "$str" $start_substr_idx]
if { $sepidx == -1 } {
return ""