RE: [RFC] Fix problems related to Mingw/DJGPP file names containing colons

Pierre Muller
2011-08-13T10:11:34Z

> -----Message d'origine-----
> De : gdb-patches-owner@sourceware.org [mailto:gdb-patches-
> owner@sourceware.org] De la part de Eli Zaretskii
> Envoyé : vendredi 12 août 2011 19:47
> À : Tom Tromey
> Cc : pierre.muller@ics-cnrs.unistra.fr; gdb-patches@sourceware.org
> Objet : Re: [RFC] Fix problems related to Mingw/DJGPP file names
containing
> colons
>
> > From: Tom Tromey <tromey@redhat.com>
> > Cc: Pierre Muller <pierre.muller@ics-cnrs.unistra.fr>,
> > gdb-patches@sourceware.org
> > Date: Fri, 12 Aug 2011 11:24:56 -0600
> >
> > Eli> Thanks for working on this, but I don't like the idea of quoting
file
> > Eli> names internally just to work around this problem.
> >
> > Why?
>
> 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.

Regarding the reverting of
As Keith said, I can solve this problem only by revert this change:
------------------------------
if (!*p
|| p[0] == '\t'
- || ((p[0] == ':')
- && ((p[1] == ':') || (strchr (p + 1, ':') == NULL)))
+ || (p[0] == ':')

This probably creates problems with some C++
cases that use '::' patterns, no?

Pierre