diff options
author | Danny Smith <dannysmith@users.sourceforge.net> | 2004-05-31 10:30:00 +0000 |
---|---|---|
committer | Danny Smith <dannysmith@gcc.gnu.org> | 2004-05-31 10:30:00 +0000 |
commit | 421563d59a5d6d21a90066d79dda8ac825e578e3 (patch) | |
tree | 39c8a7f12308f840d20360b28501b3f8dabcd472 /gcc/c-incpath.c | |
parent | 1c052514f657db4f56b876814fee2ffd564fae59 (diff) | |
download | gcc-421563d59a5d6d21a90066d79dda8ac825e578e3.zip gcc-421563d59a5d6d21a90066d79dda8ac825e578e3.tar.gz gcc-421563d59a5d6d21a90066d79dda8ac825e578e3.tar.bz2 |
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
Diffstat (limited to 'gcc/c-incpath.c')
-rw-r--r-- | gcc/c-incpath.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/gcc/c-incpath.c b/gcc/c-incpath.c index 8bd18c6..2f00d62 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; |