diff options
author | ragge <ragge> | 2009-08-15 08:24:22 +0000 |
---|---|---|
committer | ragge <ragge> | 2009-08-15 08:24:22 +0000 |
commit | 741faae86a0292360ad24f8b160778b7097c6bff (patch) | |
tree | 1ef0f7738e18e94c7752bf58a825a353a2ba5b72 | |
parent | 55519c3fb700154a19d78b51af77a2e097c83028 (diff) |
Must expand identifier in #include directive. sloscan() don't do it and
yylex() will return a NUMBER. Fixes Jira#PCC-76 by Detlef Riekenberg.
-rw-r--r-- | cpp.c | 13 |
1 files changed, 12 insertions, 1 deletions
@@ -492,6 +492,7 @@ bad: error("bad line directive"); void include() { + struct symtab *nl; struct incs *w; usch *osp; usch *fn, *safefn; @@ -501,7 +502,17 @@ include() return; osp = stringbuf; - if ((c = yylex()) != STRING && c != '<') + while ((c = sloscan()) == WSPACE) + ; + if (c == IDENT) { + /* sloscan() will not expand idents */ + if ((nl = lookup((usch *)yytext, FIND)) == NULL) + goto bad; + unpstr(gotident(nl)); + stringbuf = osp; + c = yylex(); + } + if (c != STRING && c != '<') goto bad; if (c == '<') { |