Index: library/targetselection.itb =================================================================== RCS file: /cvs/src/src/gdb/gdbtk/library/targetselection.itb,v retrieving revision 1.12 diff -u -r1.12 targetselection.itb --- library/targetselection.itb 15 Oct 2002 21:19:51 -0000 1.12 +++ library/targetselection.itb 4 Feb 2003 07:19:41 -0000 @@ -877,12 +877,16 @@ # which is OK because we may be using it or the user # may be setting up the remote target manually with # a terminal program. - for {set i 1} {$i < 9} { incr i} { + set quit 0 + for {set i 1} {!$quit} {incr i} { if {[catch { set fd [::open COM$i: RDWR] } msg]} { # Failed. Find out why. if {[string first "permission denied" $msg] != -1} { # Port is there, but busy right now. That's OK. lappend plist com$i + } elseif {$i > 4} { + # if we've scanned the first 4 ports, then quit when we find no more + set quit 1 } } else { # We got it. Now close it and add to list.