0
0
mirror of https://github.com/netwide-assembler/nasm.git synced 2025-09-22 10:43:39 -04:00

preproc.c: %include: use expand_smacros() not expand_smacros_in_string()

Call expand_smacros() early instead of expand_smacros_in_string()
late.  expand_smacros_in_string() seems like a prodigiously bad idea
and a sheer brainfart in my opinion.
This commit is contained in:
H. Peter Anvin
2008-05-30 10:09:45 -07:00
parent e63e62be46
commit 477f2e5fa9

View File

@@ -2061,7 +2061,7 @@ static int do_directive(Token * tline)
return DIRECTIVE_FOUND;
case PP_INCLUDE:
tline = tline->next;
tline = expand_smacros(tline->next);
skip_white_(tline);
if (!tline || (tline->type != TOK_STRING &&
tline->type != TOK_INTERNAL_STRING)) {
@@ -2077,7 +2077,6 @@ static int do_directive(Token * tline)
p[strlen(p) - 1] = '\0'; /* remove the trailing quote */
} else
p = tline->text; /* internal_string is easier */
expand_macros_in_string(&p);
inc = nasm_malloc(sizeof(Include));
inc->next = istk;
inc->conds = NULL;