[RFA] Fix mi-break.exp: 'b "basics.c":16'
Michael Elizabeth Chastain
mec@shout.net
Wed Apr 3 07:58:00 GMT 2002
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.
More information about the Gdb-patches
mailing list