This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [RFA] Fix mi-break.exp: 'b "basics.c":16'
- From: Michael Elizabeth Chastain <mec at shout dot net>
- To: drow at mvista dot com, gdb-patches at sources dot redhat dot com
- Date: Wed, 3 Apr 2002 09:58:24 -0600
- Subject: Re: [RFA] Fix mi-break.exp: 'b "basics.c":16'
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?
Michael C
2002-04-02 Daniel Jacobowitz <drow@mvista.com>
* linespec.c (decode_line_1): Check for a double quote after
a filename correctly.