summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2008-05-30 10:09:45 -0700
committerH. Peter Anvin <hpa@zytor.com>2008-05-30 10:09:45 -0700
commit477f2e5fa91e4f93ae5341a5fc5b700f98b42c45 (patch)
treeec902cba59d56ef9c4698ea61188ff3f6b70172b
parente63e62be4612e9c948d03d738d2968cc6d878d26 (diff)
downloadnasm-477f2e5fa91e4f93ae5341a5fc5b700f98b42c45.tar.gz
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.
-rw-r--r--preproc.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/preproc.c b/preproc.c
index c42cdfd8..3b4c12f8 100644
--- a/preproc.c
+++ b/preproc.c
@@ -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;