diff options
author | bkoz <bkoz@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-09-25 04:46:44 +0000 |
---|---|---|
committer | bkoz <bkoz@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-09-25 04:46:44 +0000 |
commit | 25a6091db459b5ee9f0ca0cc7ce253ff46d27030 (patch) | |
tree | 7ff910a3d20817f9f6bc4c1bff79279b98d52685 /gcc/cppfiles.c | |
parent | 8915e2cc8c8aea7e9323a06452cb51f39286cff8 (diff) | |
download | ppe42-gcc-25a6091db459b5ee9f0ca0cc7ce253ff46d27030.tar.gz ppe42-gcc-25a6091db459b5ee9f0ca0cc7ce253ff46d27030.zip |
2003-09-24 Phil Edwards <phil@codesourcery.com>
PR pch/12112
* gcc/cppfiles.c (pch_open_file): Return based on combined
result of all files.
(validate_pch): Return validate flag for current file.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@71751 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cppfiles.c')
-rw-r--r-- | gcc/cppfiles.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/gcc/cppfiles.c b/gcc/cppfiles.c index a4edd5da33b..10aee4f5bd7 100644 --- a/gcc/cppfiles.c +++ b/gcc/cppfiles.c @@ -273,6 +273,9 @@ pch_open_file (cpp_reader *pfile, _cpp_file *file) while ((d = readdir (pchdir)) != NULL) { dlen = strlen (d->d_name) + 1; + if ((strcmp (d->d_name, ".") == 0) + || (strcmp (d->d_name, "..") == 0)) + continue; if (dlen + plen > len) { len += dlen + 64; @@ -285,6 +288,7 @@ pch_open_file (cpp_reader *pfile, _cpp_file *file) } closedir (pchdir); } + file->pch |= valid; } if (valid) @@ -1185,14 +1189,14 @@ static bool validate_pch (cpp_reader *pfile, _cpp_file *file, const char *pchname) { const char *saved_path = file->path; + bool valid = false; file->path = pchname; if (open_file (file)) { - if ((file->pch & 2) == 0) - file->pch = pfile->cb.valid_pch (pfile, pchname, file->fd); + valid = 1 & pfile->cb.valid_pch (pfile, pchname, file->fd); - if (!include_pch_p (file)) + if (!valid) { close (file->fd); file->fd = -1; @@ -1204,12 +1208,10 @@ validate_pch (cpp_reader *pfile, _cpp_file *file, const char *pchname) for (i = 1; i < pfile->line_maps.depth; i++) putc ('.', stderr); fprintf (stderr, "%c %s\n", - include_pch_p (file) ? '!' : 'x', pchname); + valid ? '!' : 'x', pchname); } } - else - file->pch = 2; file->path = saved_path; - return include_pch_p (file); + return valid; } |