Skip to content

Commit 717a7d4

Browse files
committed
emccalib: ignore ini refs embedded in pin names
Only treat a setp line as tunable when the ini reference is the value being set, not when it appears inside the pin name. Fixes the invalid widget name crash in the calibration tool (issue #4165).
1 parent 2be516b commit 717a7d4

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

tcl/bin/emccalib.tcl

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,12 +179,16 @@ proc find_ini_refs {stanza} {
179179
if { [lindex $halcommand 1] == "\=" } {
180180
set tmpstring "setp [lindex $halcommand 0] [lindex $halcommand 2]"
181181
}
182+
# tunable item is the setp value (3rd token); ignore ini refs
183+
# that only appear inside the pin name (issue #4165)
184+
set valuestring [lindex $tmpstring 2]
182185
for {set sfx 0} {$sfx < $::EC($stanza,howmany)} {incr sfx} {
183186
set tabno $::EC($stanza,$sfx,tabno)
184187
set itag [lindex $::EC($stanza,suffixes) $sfx]
185-
if {[string match *${stanza}${itag}* $tmpstring]} {
188+
if {[string match *${stanza}${itag}* $valuestring]} {
186189
# this is a hal file search ordered loop
187-
set thisininame [string trimright [lindex [split $tmpstring "\]" ] end ]]
190+
set thisininame [lindex [split $valuestring "\]" ] end ]
191+
set thisininame [string map {( "" ) ""} $thisininame]
188192
set lowername "[string tolower $thisininame]"
189193
set thishalcommand [lindex $tmpstring 1]
190194
set tmpval [string trim [hal getp [halcmdSubstitute $thishalcommand]]]

0 commit comments

Comments
 (0)