[hackers] [scc] [cc1] Fix continuation after macro expansion || Roberto E. Vargas Caballero

From: <git_AT_suckless.org>
Date: Wed, 11 Jan 2017 16:53:19 +0100 (CET)

commit e2a52562d6ba87fc4b4a82a75ae9bb992e8153a1
Author: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
AuthorDate: Wed Jan 11 16:16:15 2017 +0100
Commit: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
CommitDate: Wed Jan 11 16:16:15 2017 +0100

    [cc1] Fix continuation after macro expansion
    
    When a macro is expanded a new push up buffer is created,
    but after returning from the macro expansion the original
    buffer can still have pending characters.

diff --git a/cc1/lex.c b/cc1/lex.c
index 130c586..f190154 100644
--- a/cc1/lex.c
+++ b/cc1/lex.c
_AT_@ -207,10 +207,15 @@ readline(void)
         char c, peekc = 0;
 
 repeat_from_file:
- input->begin = input->p = input->line;
         *input->line = '\0';
+ input->p = input->line;
 
 repeat_from_expand:
+ input->begin = input->p;
+
+ if (*input->begin)
+ return 1;
+
         if (eof)
                 return 0;
 
Received on Wed Jan 11 2017 - 16:53:19 CET

This archive was generated by hypermail 2.3.0 : Wed Jan 11 2017 - 17:00:17 CET