Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Daniel Jacobowitz <drow@mvista.com>
To: Michael Elizabeth Chastain <mec@shout.net>
Cc: gdb-patches@sources.redhat.com
Subject: Re: [RFA] Fix mi-break.exp: 'b "basics.c":16'
Date: Wed, 03 Apr 2002 08:20:00 -0000	[thread overview]
Message-ID: <20020403112015.B25681@nevyn.them.org> (raw)
In-Reply-To: <200204031558.g33FwO705749@duracef.shout.net>

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  <drow@mvista.com>
> 
> 	  * 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


  reply	other threads:[~2002-04-03 16:20 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-04-03  7:58 Michael Elizabeth Chastain
2002-04-03  8:20 ` Daniel Jacobowitz [this message]
  -- strict thread matches above, loose matches on Subject: below --
2002-04-03  9:39 Michael Elizabeth Chastain
2002-04-03  8:39 Michael Elizabeth Chastain
2002-04-02 16:29 Daniel Jacobowitz
2002-05-09 15:31 ` Daniel Jacobowitz
2002-05-09 15:35   ` Elena Zannoni
2002-05-09 15:53 ` Michael Snyder
2002-05-09 16:05   ` Daniel Jacobowitz
2002-05-09 16:32     ` Elena Zannoni
2002-05-10 12:50       ` Daniel Jacobowitz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20020403112015.B25681@nevyn.them.org \
    --to=drow@mvista.com \
    --cc=gdb-patches@sources.redhat.com \
    --cc=mec@shout.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox