diff --git a/tccpp.c b/tccpp.c index 08b70ba7..1e688f7c 100644 --- a/tccpp.c +++ b/tccpp.c @@ -2633,7 +2633,8 @@ static inline void next_nomacro1(void) s1->include_stack_ptr--; p = file->buf_ptr; if (p == file->buffer) - tok_flags = TOK_FLAG_BOF|TOK_FLAG_BOL; + tok_flags = TOK_FLAG_BOF; + tok_flags |= TOK_FLAG_BOL; goto redo_no_start; } } else { diff --git a/tests/tests2/18_include.c b/tests/tests2/18_include.c index 4ec733c2..a85327e5 100644 --- a/tests/tests2/18_include.c +++ b/tests/tests2/18_include.c @@ -4,6 +4,7 @@ int main() { printf("including\n"); #include "18_include.h" +#define test_missing_nl printf("done\n"); #define INC "18_include.h" diff --git a/tests/tests2/18_include.h b/tests/tests2/18_include.h index dc860802..cad2433f 100644 --- a/tests/tests2/18_include.h +++ b/tests/tests2/18_include.h @@ -1 +1,5 @@ printf("included\n"); +/* test file with missing newline */ +#ifndef INCLUDE +#define INCLUDE +#endif /* INCLUDE */ \ No newline at end of file