OSDN Git Service

* c-incpath.c (add_path): Canonicalize paths to use '/' if
authordannysmith <dannysmith@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 31 May 2004 10:30:00 +0000 (10:30 +0000)
committerdannysmith <dannysmith@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 31 May 2004 10:30:00 +0000 (10:30 +0000)
HAVE_DOS_BASED_FILESYSTEM.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@82481 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/c-incpath.c

index ca109d9..20c59e5 100644 (file)
@@ -1,3 +1,8 @@
+2004-05-31  Danny Smith  <dannysmith@users.sourceforge.net>
+
+       * c-incpath.c (add_path): Canonicalize paths to use '/' if
+       HAVE_DOS_BASED_FILESYSTEM.
+
 2004-05-31  Steven Bosscher  <stevenb@suse.de>
 
        * tree-ssa-dom.c (record_equivalences_from_incoming_edge):
index 8bd18c6..2f00d62 100644 (file)
@@ -327,6 +327,16 @@ add_path (char *path, int chain, int cxx_aware, bool user_supplied_p)
 {
   cpp_dir *p;
 
+#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
+  /* Convert all backslashes to slashes.  The native CRT stat()
+     function does not recognise a directory that ends in a backslash
+     (unless it is a drive root dir, such "c:\").  Forward slashes,
+     trailing or otherwise, cause no problems for stat().  */
+  char* c;
+  for (c = path; *c; c++)
+    if (*c == '\\') *c = '/';
+#endif
+
   p = xmalloc (sizeof (cpp_dir));
   p->next = NULL;
   p->name = path;