[patch] avoid '//' prefixes when sysroot is set to '/'

Joseph S. Myers joseph@codesourcery.com
Thu Jan 26 17:57:00 GMT 2012


On Thu, 26 Jan 2012, Matthias Klose wrote:

> On 25.01.2012 17:45, Joseph S. Myers wrote:
> > On Wed, 25 Jan 2012, Matthias Klose wrote:
> > 
> > > This can end up in generation for dependency files, and other files
> > > parsing
> > > the output. The solution I came up with is to check for sysroot set to '/'
> > > and
> > > special case this in two places. Afaics, there are no other places.
> > 
> > I could imagine a sysroot path that isn't just '/' but ends with '/'
> > resulting in duplicate '/' in the middle of the path - although that's not
> > a correctness issue in the way that '//' at the start could be, maybe the
> > best check is actually for '/' at end of sysroot (in which case skip the
> > '/' at the start of the path within the sysroot)?
> 
> as in the attached trailing.diff? built and regression tested.

Yes, that's OK (with copyright date updates in incpath.c).

-- 
Joseph S. Myers
joseph@codesourcery.com



More information about the Gcc-patches mailing list