This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: RFA: Fix problem with trailing slashes in include paths on mingw


Zack Weinberg wrote:



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)


These are all OK.

C:\foo\bar\ -- ?


NOT Ok.

C:/foo/bar/ -- not ok


Indeed.

C:\foo\\bar -- ?


OK.

C:/foo//bar -- ?


OK.

C:\foo\bar\\ -- ?


NOT Ok.

C:/foo/bar// -- presumably not ok


Indeed, not OK.

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
comment says.)

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.

Ok, how about that:

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





+#if 1



Remove, unnecessary (we're already inside #ifdef HAVE_DOS_BASED_FILE_SYSTEM here).


I wasn't sure if the problem was specific to cygwin. Now that I've witten a test program,
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 uses mingw.
It's probably easies to just remove the #if.



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]