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

Graham Shaw gdshaw at sagitta.demon.co.uk
Tue Jun 1 10:57:54 PDT 2004


In article <40BC8B6F.6060702 at dsvr.net>,
   Nick Burrett <nick at dsvr.net> wrote:
> 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
> ../../"

No, I tried that but couldn't make either style work.

> > 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.

My apologies: I was using Peter's 32-bit version, not the 2.95 branch in
CVS.  The differences are the same but the context is very slightly
different.  Please find attached.

-- 
Graham Shaw (http://www.sagitta.demon.co.uk/graham/)
The RISC OS Packaging Project (http://www.riscpkg.org/)
The RISC OS Toolkit (http://rtk.riscos.org.uk/)

begin 644 patch4-gcc-295
M9&EF9B`M<G4@=7!S=')E86TO9V-C+V=C8R]C;VYF:6<O87)M+W)N86UE+F,@
M<&%T8VAE9"]G8V,O9V-C+V-O;F9I9R]A<FTO<FYA;64N8PHM+2T@=7!S=')E
M86TO9V-C+V=C8R]C;VYF:6<O87)M+W)N86UE+F,)36]N($UA>2`S,2`R,#HP
M-CHS,2`R,#`T"BLK*R!P871C:&5D+V=C8R]G8V,O8V]N9FEG+V%R;2]R;F%M
M92YC"4UO;B!-87D@,S$@,C`Z-#(Z-3<@,C`P-`I`0"`M,S0L-R`K,S0L-R!`
M0`H@<W1A=&EC(&EN=`H at 9V5T7V1I<F5C=&]R>5]N86UE("AC;VYS="!C:&%R
M("II;G!U="P at 8VAA<B`J;W5T<'5T*0H@>PH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I9 at HM("`O*B!)9B!W92!R96%C:"!H97)E+"!W92!H
M879E('1W;R!P;W-S:6)I;&ET:65S. at HK"BL@(&EF("AT*0HK("!["BL@("`@
M<W1R;F-P>2`H;W5T<'5T+"!I;G!U="P@="`M(&EN<'5T*3L**R`@("!O=71P
M=71;="`M(&EN<'5T72`]("=<,"<["BL@("`@<F5T=7)N(#$["BL@('T**R`@
M96QS90HK("!["BL@("\J($EF('=E(')E86-H(&AE<F4L('=E(&AA=F4 at 9F]U
M<B!P;W-S:6)I;&ET:65S. at H@("`@("`Q+B!F;F%M90H@("`@("`R+B!D:7)E
M8W1O<GDO9FYA;64*+0HM("`@("!B;W1H(&1O;B=T(&YE960 at 86YY(&-O;G9E
M<G-I;VXN($YO+C$@:&%S(&)O=&@@8V]M<&%T:6)L92!W:71H(%))4T, at 3U,*
M+2`@("`@86YD(%5N:7 at L(&%N9"!N;RX@,B!I<R!A;')E861Y(&EN(%5N:7@@
M9F]R;2X@("HO"BT@('-T<F-P>2`H;W5T<'5T+"!I;G!U="D["BT@(')E='5R
M;B`P.PHK("`@("`S+B`N"BL@("`@(#0N("XN"BL@("`@(&YO;F4@;V8@=VAI
M8V@@;F5E9"!A;GD at 8V]N=F5R<VEO;BX at 3F\N,2!H87, at 8F]T:"!C;VUP871I
M8FQE('=I=&@**R`@("`@4DE30R!/4R!A;F0 at 56YI>"P at 86YD(&YO<RX@,BTT
M(&%R92!A;')E861Y(&EN(%5N:7@@9F]R;2X@("HO"BL@("`@<W1R8W!Y("AO
M=71P=70L(&EN<'5T*3L**R`@("!R971U<FX@,#L**R`@?0H@?0H@"B!S=&%T
*:6, at 8VAA<B`J"@``
`
end
RiscOS filetype : FFF





More information about the gcc mailing list