Ignore:
Timestamp:
Jan 6, 2004, 5:04:36 AM (15 years ago)
Author:
jkh
Message:

Fix ldelete to return a modified list, just as the other l* procs do. This
fixes the root cause of the ethereal port problem. Since this is the case,
also remove the safety-belt added to options_proc_trace since it's no longer
necessary and I'd just as soon have it error out to avoid masking future
problems of this nature. Many thanks to Toby for tracking this down!

Submitted by: Toby Peterson <tp62@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/base/src/port1.0/portutil.tcl

    r4466 r4473  
    109109                \if \{!\[info exists user_options(${option})\]\} \{ \n\
    110110                    foreach val \$args \{ \n\
    111                         ldelete ${option} \$val \n\
     111                       set ${option} \[ldelete \$\{$option\} \$val\] \n\
    112112                    \} \n\
    113113                    if \{\[string length \$\{${option}\}\] == 0\} \{ \n\
     
    179179    global option_procs
    180180    upvar $optionName optionValue
    181     if {![info exists option_procs($optionName)]} {
    182         return
    183     }
    184181    switch $op {
    185182        w {
     
    421418# Deletes a value from the supplied list
    422419proc ldelete {list value} {
    423     upvar $list uplist
    424     set ix [lsearch -exact $uplist $value]
     420    set ix [lsearch -exact $list $value]
    425421    if {$ix >= 0} {
    426         set uplist [lreplace $uplist $ix $ix]
    427     }
     422        return [lreplace $list $ix $ix]
     423    }
     424    return $list
    428425}
    429426
Note: See TracChangeset for help on using the changeset viewer.