This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFC] Fix problems related to Mingw/DJGPP file names containing colons
- From: Eli Zaretskii <eliz at gnu dot org>
- To: Pierre Muller <pierre dot muller at ics-cnrs dot unistra dot fr>
- Cc: tromey at redhat dot com, gdb-patches at sourceware dot org
- Date: Sat, 13 Aug 2011 13:50:34 +0300
- Subject: Re: [RFC] Fix problems related to Mingw/DJGPP file names containing colons
- References: <004901cc5907$85006320$8f012960$%muller@ics-cnrs.unistra.fr> <83vcu2wnvj.fsf@gnu.org> <m34o1mlezb.fsf@fleche.redhat.com> <83sjp6wmhb.fsf@gnu.org> <003c01cc59a1$49cc1520$dd643f60$%muller@ics-cnrs.unistra.fr>
- Reply-to: Eli Zaretskii <eliz at gnu dot org>
> From: "Pierre Muller" <pierre.muller@ics-cnrs.unistra.fr>
> Cc: <gdb-patches@sourceware.org>
> Date: Sat, 13 Aug 2011 12:10:53 +0200
>
> > It's ugly and fragile, because the original name could be quoted.
>
> + /* Quote filenames containing ':' characters to avoid problems. */
> + if (strchr (filename, ':') != NULL && filename[0] != '"')
> + sprintf (canonical_name, "\"%s\":%d", filename, sal->line);
>
> The second condition already takes care of not
> quoting already quoted file names.
What if the original name already includes quote characters? That can
happen on Posix platforms.