From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tom Tromey To: Insight List Subject: completion fix Date: Thu, 13 Apr 2000 18:14:00 -0000 Message-id: <87og7dh49u.fsf@cygnus.com> X-SW-Source: 2000-q2/msg00071.html I'm debugging gcj. I bring up the console and type: b build_jni There is only one function that this can possibly complete. Insight changes it to "b build_jni_stub" and beeps. This annoyed me, so I looked at the code. I added some debugging prints and it turns out that the switch statement was written incorrectly. Also, the `1' branch had an obvious bug. (Code like `switch {' is almost always wrong. I didn't grep through the source to see if this error is in more than one place.) Here is a patch. (BTW I gave myself write permission for the `src' repo on sourceware, because I had some dejagnu patches to check in. So if you want I can commit this myself. If you'd rather not, that is also fine -- it doesn't matter to me.) 2000-04-13 Tom Tromey * console.itb (Console::_complete): Dequoted first argument to switch. Window name is `$_twin', not `_twin'. Tom Index: library/console.itb =================================================================== RCS file: /cvs/src/src/gdb/gdbtk/library/console.itb,v retrieving revision 1.2 diff -u -r1.2 console.itb --- console.itb 2000/04/10 16:49:30 1.2 +++ console.itb 2000/04/14 01:11:50 @@ -566,10 +566,10 @@ # is one match, complete the command and print a space. # If two or more matches, complete the command and beep. # If no match, just beep. - switch {[llength $choices]} { + switch [llength $choices] { 0 {} 1 { - _twin insert end "$completion " + $_twin insert end "$completion " set _saw_tab 0 return }