X-Git-Url: http://git.sourceforge.jp/view?a=blobdiff_plain;f=gcc%2Fc-incpath.c;h=2f00d62bb63aae2ab7ba2fdeb0d41a458d5d4357;hb=a73be86cc6b63abb2a17e9358afde3c456eaf5df;hp=ea83c1a18b493d5b0ed07c41a22db3b9cb45db6c;hpb=06fd18c9e3c5c0af056bda9beef74491532a973e;p=pf3gnuchains%2Fgcc-fork.git diff --git a/gcc/c-incpath.c b/gcc/c-incpath.c index ea83c1a18b4..2f00d62bb63 100644 --- a/gcc/c-incpath.c +++ b/gcc/c-incpath.c @@ -193,7 +193,7 @@ remove_duplicates (cpp_reader *pfile, struct cpp_dir *head, cpp_errno (pfile, CPP_DL_ERROR, cur->name); else { - /* If -Wmissing-include-dirs is given, warn. */ + /* If -Wmissing-include-dirs is given, warn. */ cpp_options *opts = cpp_get_options (pfile); if (opts->warn_missing_include_dirs && cur->user_supplied_p) cpp_errno (pfile, CPP_DL_WARNING, cur->name); @@ -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;