CPP filename translation: problem with . or .. at end of pathname

Nick Burrett nick at dsvr.net
Tue Jun 1 06:58:07 PDT 2004


Graham Shaw wrote:
> CPP does not appear able to find files when given an include path such as
> "../..".
> 
> The problem appears to lie in the function get_directory_name() (in
> gcc/gcc/config/arm/rname.c) and affects any path ending in "." or "..".
> 
> (This function correctly handles "." and ".." when they appear in the
> middle of a pathname, followed by "/", but not at the end.  Quite possibly
> it was written with files in mind rather than directories.)

I think the code has only been tested with a trailing slash i.e. "-I ../../"

> Attached is a patch against GCC 2.95.  I've had a quick look at the head
> revision and it should work there too.  It returns ".\0" and "..\0"
> without conversion, while continuing to handle "./" and "../" in the
> existing manner.

I've committed your fix to the head revision: your change does not apply 
against the 2.95 branch.

Cheers,

Nick.


-- 
Nick Burrett, Senior Systems and Network Engineer
Designer Servers Ltd.   http://www.dsvr.co.uk





More information about the gcc mailing list