This is the mail archive of the
insight@sources.redhat.com
mailing list for the Insight project.
Re: Patch: fix for new bug in console
- To: tromey at redhat dot com
- Subject: Re: Patch: fix for new bug in console
- From: Fernando Nasser <fnasser at cygnus dot com>
- Date: Fri, 08 Dec 2000 15:05:01 -0500
- CC: Insight List <insight at sourceware dot cygnus dot com>
- Organization: Red Hat , Inc. - Toronto
- References: <87ofym4wus.fsf@creche.redhat.com>
Tom Tromey wrote:
>
> Yesterday's patch to console.itb introduced a bug.
>
> Here is a recipe to see it:
>
> * Run Insight
> * Bring up Console
> * Type `tk puts stderr foo'
> * Type `q'
>
> You'll get an error from Insight.
>
> The problem is that the old code omitted trailing newlines from $text
> but the new code preserves them.
>
> This patch fixes the bug. Ok?
>
Sure. Thanks.
Fernando
> 2000-12-08 Tom Tromey <tromey@redhat.com>
>
> * console.itb (Console::invoke): Trim trailing newlines from
> text.
>
> Tom
>
> Index: console.itb
> ===================================================================
> RCS file: /cvs/src/src/gdb/gdbtk/library/console.itb,v
> retrieving revision 1.6
> diff -u -r1.6 console.itb
> --- console.itb 2000/12/07 19:49:40 1.6
> +++ console.itb 2000/12/08 17:47:40
> @@ -397,6 +397,7 @@
>
> incr _invoking
>
> + set text [string trimright $text \n]
> if {$text == ""} {
> set text [lindex $_history 0]
> $_twin insert {insert lineend} $text
--
Fernando Nasser
Red Hat - Toronto E-Mail: fnasser@redhat.com
2323 Yonge Street, Suite #300
Toronto, Ontario M4P 2C9