aboutsummaryrefslogtreecommitdiff
path: root/libcpp/files.c
diff options
context:
space:
mode:
authorJoey Ye <joey.ye@arm.com>2014-05-09 08:50:22 +0000
committerJoey Ye <jye2@gcc.gnu.org>2014-05-09 08:50:22 +0000
commiteac3e079667d0a56f2ba84469a764407f3aee2a9 (patch)
treec9f7d29dd85287f19f93e20d63a9e63a168ee41a /libcpp/files.c
parent9db25c6a05578b77f219c789df54ba6f81bcf40d (diff)
downloadgcc-eac3e079667d0a56f2ba84469a764407f3aee2a9.zip
gcc-eac3e079667d0a56f2ba84469a764407f3aee2a9.tar.gz
gcc-eac3e079667d0a56f2ba84469a764407f3aee2a9.tar.bz2
files.c (find_file_in_dir): Always try to shorten for DOS non-system headers.
2014-05-09 Joey Ye <joey.ye@arm.com> * files.c (find_file_in_dir): Always try to shorten for DOS non-system headers. * init.c (ENABLE_CANONICAL_SYSTEM_HEADERS): Default enabled for DOS. From-SVN: r210264
Diffstat (limited to 'libcpp/files.c')
-rw-r--r--libcpp/files.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/libcpp/files.c b/libcpp/files.c
index 7e88778..ad68682 100644
--- a/libcpp/files.c
+++ b/libcpp/files.c
@@ -387,8 +387,14 @@ find_file_in_dir (cpp_reader *pfile, _cpp_file *file, bool *invalid_pch)
char *copy;
void **pp;
- /* We try to canonicalize system headers. */
- if (CPP_OPTION (pfile, canonical_system_headers) && file->dir->sysp)
+ /* We try to canonicalize system headers. For DOS based file
+ * system, we always try to shorten non-system headers, as DOS
+ * has a tighter constraint on max path length. */
+ if (CPP_OPTION (pfile, canonical_system_headers) && file->dir->sysp
+#ifdef HAVE_DOS_BASED_FILE_SYSTEM
+ || !file->dir->sysp
+#endif
+ )
{
char * canonical_path = maybe_shorter_path (path);
if (canonical_path)