This is the mail archive of the
mailing list for the GCC project.
Re: RFA: Fix problem with trailing slashes in include paths on mingw
- From: Joern RENNECKE <joern dot rennecke at st dot com>
- To: Zack Weinberg <zack at codesourcery dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Tue, 17 May 2005 13:36:55 +0100
- Subject: Re: RFA: Fix problem with trailing slashes in include paths on mingw
- References: <4284D81E.email@example.com> <firstname.lastname@example.org>
Zack Weinberg wrote:
These are all OK.
I want to be sure I understand the problem cases:
C:\ -- ok
C:/ -- ok?
C:\\ -- ?
C:// -- ?
C:\foo\bar -- ok
C:/foo/bar -- ok (or you have bigger problems)
C:\foo\bar\ -- ?NOT Ok.
C:/foo/bar/ -- not okIndeed.
C:\foo\\bar -- ?OK.
C:/foo//bar -- ?OK.
C:\foo\bar\\ -- ?NOT Ok.
C:/foo/bar// -- presumably not okIndeed, not OK.
Ok, how about that:
Please check which, if any, of the ? cases are affected. (The comment
immediately above the code you added purports to explain, but since we
have already determined that the code is buggy, I don't trust what the
Please also check all the above cases with a leading slash (or
backslash) but no drive letter; with a drive letter but no leading
slash (or backslash); and with neither a drive letter nor a leading
slash (or backslash); omitting, of course, those paths that when
transformed are vacuous or identical to already-tested cases.
+/* While the native stat() on NT4 accepts slashes, the one on
+ MS Windows 2000 / XP does not. So remove any trailing slashes
+ except for the first one after a colon. */
Once you've checked, please modify this comment to be clearer about
what works and what doesn't.
/* While the native stat() on NT4 accepts trailing slashes, the
one on MS Windows 2000 / XP does not accept any trailing slashes
or backslashes, neither single nor double, except where they appear
as a drive root directory designator. So remove any trailing slashes
except for the first one after a colon. */
I wasn't sure if the problem was specific to cygwin. Now that I've
witten a test program,
Remove, unnecessary (we're already inside #ifdef HAVE_DOS_BASED_FILE_SYSTEM
I can confiorm that it is cygwin specific. It is not incorrect to do
this transformation all the time,
though. I'm not sure what the right test is to check if the host system
It's probably easies to just remove the #if.