This is the mail archive of the
insight@sourceware.cygnus.com
mailing list for the Insight project.
Re: completion fix
- To: tromey at cygnus dot com
- Subject: Re: completion fix
- From: James Ingham <jingham at cygnus dot com>
- Date: Thu, 13 Apr 2000 18:24:28 -0700 (PDT)
- Cc: Insight List <insight at sourceware dot cygnus dot com>
- References: <87og7dh49u.fsf@cygnus.com>
Tom,
Yup, thems code that weren't ever gonna work. Check it in, thanks...
Jim
> I'm debugging gcj. I bring up the console and type:
>
> b build_jni<Tab>
>
> 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 <tromey@cygnus.com>
>
> * 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
> }
>