From 7cb921a44b979ae3fa280a1b0f567300667af903 Mon Sep 17 00:00:00 2001 From: seyko Date: Fri, 6 Nov 2015 02:40:14 +0300 Subject: [PATCH] TOK_INCLUDE: streamline goto removed --- tccpp.c | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/tccpp.c b/tccpp.c index 9597ec2..900781d 100644 --- a/tccpp.c +++ b/tccpp.c @@ -1570,14 +1570,13 @@ ST_FUNC void preprocess(int is_bof) case TOK_INCLUDE: case TOK_INCLUDE_NEXT: ch = file->buf_ptr[0]; - /* XXX: incorrect if comments : use next_nomacro with a special mode */ - skip_spaces(); - if (ch == '<') { + skip_spaces(); /* XXX: incorrect if comments : use next_nomacro with a special mode */ + c = 0; + if (ch == '<') c = '>'; - goto read_name; - } else if (ch == '\"') { + if (ch == '\"') c = ch; - read_name: + if (c) { inp(); q = buf; while (ch != c && ch != '\n' && ch != CH_EOF) { @@ -1591,12 +1590,6 @@ ST_FUNC void preprocess(int is_bof) } *q = '\0'; minp(); -#if 0 - /* eat all spaces and comments after include */ - /* XXX: slightly incorrect */ - while (ch1 != '\n' && ch1 != CH_EOF) - inp(); -#endif } else { /* computed #include : either we have only strings or we have anything enclosed in '<>' */