From: Danny Smith Date: Mon, 31 May 2004 10:30:00 +0000 (+0000) Subject: c-incpath.c (add_path): Canonicalize paths to use '/' if HAVE_DOS_BASED_FILESYSTEM. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=421563d59a5d6d21a90066d79dda8ac825e578e3;p=gcc.git c-incpath.c (add_path): Canonicalize paths to use '/' if HAVE_DOS_BASED_FILESYSTEM. * c-incpath.c (add_path): Canonicalize paths to use '/' if HAVE_DOS_BASED_FILESYSTEM. From-SVN: r82481 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index ca109d99911..20c59e5f4c0 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2004-05-31 Danny Smith + + * c-incpath.c (add_path): Canonicalize paths to use '/' if + HAVE_DOS_BASED_FILESYSTEM. + 2004-05-31 Steven Bosscher * tree-ssa-dom.c (record_equivalences_from_incoming_edge): diff --git a/gcc/c-incpath.c b/gcc/c-incpath.c index 8bd18c62b12..2f00d62bb63 100644 --- a/gcc/c-incpath.c +++ b/gcc/c-incpath.c @@ -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;