This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]