From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4786 invoked by alias); 27 Mar 2002 21:21:24 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 4779 invoked from network); 27 Mar 2002 21:21:23 -0000 Received: from unknown (HELO Cantor.suse.de) (213.95.15.193) by sources.redhat.com with SMTP; 27 Mar 2002 21:21:23 -0000 Received: from Hermes.suse.de (Hermes.suse.de [213.95.15.136]) by Cantor.suse.de (Postfix) with ESMTP id DC2E41EA8E; Wed, 27 Mar 2002 22:21:19 +0100 (MET) X-Authentication-Warning: sykes.suse.de: schwab set sender to schwab@suse.de using -f To: Elena Zannoni Cc: Andrew Cagney , Jason Molenda , gdb-patches@sources.redhat.com Subject: Re: Minor off-by-one error in command_line_handler References: <20020327000106.A24311@molenda.com> <3CA1F421.6010009@cygnus.com> <15522.2853.891361.517767@localhost.redhat.com> <15522.13231.951795.389737@localhost.redhat.com> X-Yow: I'm not an Iranian!! I voted for Dianne Feinstein!! From: Andreas Schwab Date: Wed, 27 Mar 2002 13:21:00 -0000 In-Reply-To: <15522.13231.951795.389737@localhost.redhat.com> (Elena Zannoni's message of "Wed, 27 Mar 2002 16:03:43 -0500") Message-ID: User-Agent: Gnus/5.090005 (Oort Gnus v0.05) Emacs/21.2.50 (ia64-suse-linux) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-SW-Source: 2002-03/txt/msg00549.txt.bz2 Elena Zannoni writes: |> Andreas Schwab writes: |> > |> > Btw., command_line_handler has this: |> > |> > |> > if (*(p - 1) == '\\') |> > { |> > p--; /* Put on top of '\'. */ |> > |> > if (*p == '\\') |> > |> > The condition in the last line is always true. |> > |> |> Yes, thanks for catching this. Would you like to submit a fix? I've checked this in as being obvious. 2002-03-27 Andreas Schwab * event-top.c (command_line_handler): Remove useless if. --- gdb/event-top.c.~1.19.~ 2002-01-18 09:37:57.000000000 +0100 +++ gdb/event-top.c 2002-03-27 22:12:23.000000000 +0100 @@ -685,20 +685,17 @@ { p--; /* Put on top of '\'. */ - if (*p == '\\') - { - readline_input_state.linebuffer = savestring (linebuffer, - strlen (linebuffer)); - readline_input_state.linebuffer_ptr = p; - - /* We will not invoke a execute_command if there is more - input expected to complete the command. So, we need to - print an empty prompt here. */ - more_to_come = 1; - push_prompt ("", "", ""); - display_gdb_prompt (0); - return; - } + readline_input_state.linebuffer = savestring (linebuffer, + strlen (linebuffer)); + readline_input_state.linebuffer_ptr = p; + + /* We will not invoke a execute_command if there is more + input expected to complete the command. So, we need to + print an empty prompt here. */ + more_to_come = 1; + push_prompt ("", "", ""); + display_gdb_prompt (0); + return; } #ifdef STOP_SIGNAL Andreas. -- Andreas Schwab, SuSE Labs, schwab@suse.de SuSE GmbH, Deutschherrnstr. 15-19, D-90429 Nürnberg Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."