public inbox for insight@sourceware.org
 help / color / mirror / Atom feed
* completion fix
@ 2000-04-13 18:14 Tom Tromey
  2000-04-13 18:21 ` James Ingham
  0 siblings, 1 reply; 2+ messages in thread
From: Tom Tromey @ 2000-04-13 18:14 UTC (permalink / raw)
  To: Insight List

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
       }

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: completion fix
  2000-04-13 18:14 completion fix Tom Tromey
@ 2000-04-13 18:21 ` James Ingham
  0 siblings, 0 replies; 2+ messages in thread
From: James Ingham @ 2000-04-13 18:21 UTC (permalink / raw)
  To: tromey; +Cc: Insight List

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
 >        }
 > 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2000-04-13 18:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-04-13 18:14 completion fix Tom Tromey
2000-04-13 18:21 ` James Ingham

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).