aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorseyko <seyko2@gmail.com>2015-10-17 14:45:51 +0300
committerseyko <seyko2@gmail.com>2015-10-17 14:45:51 +0300
commit285292992f2aba288fb82cbd881a5882ac8cb44e (patch)
tree753c25bbdda66b0860123c383a7f20b0a4273fe5
parentc3975cf27c792d493e76a2058a1eaf588324053e (diff)
downloadtinycc-285292992f2aba288fb82cbd881a5882ac8cb44e.tar.gz
tinycc-285292992f2aba288fb82cbd881a5882ac8cb44e.tar.bz2
fix for the #include_next
skip include file only if include_file_name=current_file_name
-rw-r--r--tccpp.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/tccpp.c b/tccpp.c
index 7ec0d44..2564556 100644
--- a/tccpp.c
+++ b/tccpp.c
@@ -1621,7 +1621,6 @@ ST_FUNC void preprocess(int is_bof)
for (i = -2; i < n; ++i) {
char buf1[sizeof file->filename];
CachedInclude *e;
- BufferedFile **f;
const char *path;
if (i == -2) {
@@ -1651,8 +1650,7 @@ ST_FUNC void preprocess(int is_bof)
pstrcat(buf1, sizeof(buf1), buf);
if (tok == TOK_INCLUDE_NEXT)
- for (f = s1->include_stack_ptr; f >= s1->include_stack; --f)
- if (0 == PATHCMP((*f)->filename, buf1)) {
+ if (0 == PATHCMP(file->filename, buf1)) {
#ifdef INC_DEBUG
printf("%s: #include_next skipping %s\n", file->filename, buf1);
#endif