aboutsummaryrefslogtreecommitdiff
path: root/tccpp.c
diff options
context:
space:
mode:
authorMichael Matz <matz@suse.de>2016-03-24 15:58:32 +0100
committerMichael Matz <matz@suse.de>2016-03-24 15:58:32 +0100
commit8fc5a6a2a49f05c358e293c79c0bf18e8eb4830e (patch)
tree1022e80c1e6cfebd23214f032a45061257f17fb9 /tccpp.c
parentf85db99ff0b48b5837fa985dcf9c58190b35f96a (diff)
downloadtinycc-8fc5a6a2a49f05c358e293c79c0bf18e8eb4830e.tar.gz
tinycc-8fc5a6a2a49f05c358e293c79c0bf18e8eb4830e.tar.bz2
Fix tokenization of TOK_DOTS
We really need to use PEEKC during tokenization so as to skip line continuations automatically.
Diffstat (limited to 'tccpp.c')
-rw-r--r--tccpp.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/tccpp.c b/tccpp.c
index 01f5b37..2c276c2 100644
--- a/tccpp.c
+++ b/tccpp.c
@@ -2553,9 +2553,15 @@ maybe_newline:
} else if ((isidnum_table['.' - CH_EOF] & IS_ID) != 0) { /* asm mode */
*--p = c = '.';
goto parse_ident_fast;
- } else if (c == '.' && p[1] == '.') {
- p += 2;
- tok = TOK_DOTS;
+ } else if (c == '.') {
+ PEEKC(c, p);
+ if (c == '.') {
+ p++;
+ tok = TOK_DOTS;
+ } else {
+ *--p = '.'; /* may underflow into file->unget[] */
+ tok = '.';
+ }
} else {
tok = '.';
}