From 5b450ae52870699823d0a64361d4dfb61fa8a99e Mon Sep 17 00:00:00 2001 From: Richard Stallman Date: Sat, 27 Feb 1993 19:09:40 +0000 Subject: (check_newline): #line updates input_file_stack->name. From-SVN: r3556 --- gcc/c-lex.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'gcc/c-lex.c') diff --git a/gcc/c-lex.c b/gcc/c-lex.c index 89d405f..111cf92 100644 --- a/gcc/c-lex.c +++ b/gcc/c-lex.c @@ -659,7 +659,13 @@ linenum: while (c == ' ' || c == '\t') c = getc (finput); if (c == '\n') - return c; + { + /* Update the name in the top element of input_file_stack. */ + if (input_file_stack) + input_file_stack->name = input_filename; + + return c; + } ungetc (c, finput); token = yylex (); @@ -711,6 +717,11 @@ linenum: } } + /* Now that we've pushed or popped the input stack, + update the name in the top element. */ + if (input_file_stack) + input_file_stack->name = input_filename; + /* If we have handled a `1' or a `2', see if there is another number to read. */ if (used_up) -- cgit v1.1