From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6551 invoked by alias); 3 Apr 2002 16:20:15 -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 6522 invoked from network); 3 Apr 2002 16:20:14 -0000 Received: from unknown (HELO nevyn.them.org) (128.2.145.6) by sources.redhat.com with SMTP; 3 Apr 2002 16:20:14 -0000 Received: from drow by nevyn.them.org with local (Exim 3.35 #1 (Debian)) id 16snUd-0006kn-00; Wed, 03 Apr 2002 11:20:15 -0500 Date: Wed, 03 Apr 2002 08:20:00 -0000 From: Daniel Jacobowitz To: Michael Elizabeth Chastain Cc: gdb-patches@sources.redhat.com Subject: Re: [RFA] Fix mi-break.exp: 'b "basics.c":16' Message-ID: <20020403112015.B25681@nevyn.them.org> Mail-Followup-To: Michael Elizabeth Chastain , gdb-patches@sources.redhat.com References: <200204031558.g33FwO705749@duracef.shout.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200204031558.g33FwO705749@duracef.shout.net> User-Agent: Mutt/1.3.23i X-SW-Source: 2002-04/txt/msg00069.txt.bz2 On Wed, Apr 03, 2002 at 09:58:24AM -0600, Michael Elizabeth Chastain wrote: > I have a question about this linespec patch. > > After I apply the patch, decode_line_1 looks like this: > > /* Extract the file name. */ > p1 = p; > while (p != *argptr && p[-1] == ' ') > --p; > if ((*p == '"') && is_quote_enclosed) > --p; > copy = (char *) alloca (p - *argptr + 1); > memcpy (copy, *argptr, p - *argptr); > /* It may have the ending quote right after the file name */ > if (is_quote_enclosed && copy[p - *argptr - 1] == '"') > copy[p - *argptr - 1] = 0; > else > copy[p - *argptr] = 0; > > If there is a '"' at the end, then it won't be copied into "copy". > So these lines look redundant to me: > > if (is_quote_enclosed && copy[p - *argptr - 1] == '"') > copy[p - *argptr - 1] = 0; > > Or maybe I am missing something, such as nested quotes? The two lines: if ((*p == '"') && is_quote_enclosed) --p; I left because they were there, and I don't understand every situation that can reach this code. But for "basics.c":16, *p == ':'. So the quote is actually copied. > > Michael C > > 2002-04-02 Daniel Jacobowitz > > * linespec.c (decode_line_1): Check for a double quote after > a filename correctly. > > -- Daniel Jacobowitz Carnegie Mellon University MontaVista Software Debian GNU/Linux Developer