This is the mail archive of the insight@sourceware.cygnus.com mailing list for the Insight project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

completion fix


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
       }

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]