mirror of
https://github.com/netwide-assembler/nasm.git
synced 2025-04-12 18:40:23 +08:00
preproc: %ifenv should require environment variable name to exist
Otherwise naked %ifenv/%endif passes without a notice. Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
This commit is contained in:
parent
4c6f82f78f
commit
6acada6f39
@ -1929,8 +1929,8 @@ static bool if_condition(Token * tline, enum preproc_token ct)
|
||||
case PPC_IFENV:
|
||||
tline = expand_smacro(tline);
|
||||
j = false; /* have we matched yet? */
|
||||
while (tline) {
|
||||
skip_white_(tline);
|
||||
skip_white_(tline);
|
||||
do {
|
||||
if (!tline || (tline->type != TOK_ID &&
|
||||
tline->type != TOK_STRING &&
|
||||
(tline->type != TOK_PREPROC_ID ||
|
||||
@ -1948,7 +1948,8 @@ static bool if_condition(Token * tline, enum preproc_token ct)
|
||||
if (getenv(p))
|
||||
j = true;
|
||||
tline = tline->next;
|
||||
}
|
||||
skip_white_(tline);
|
||||
} while (tline);
|
||||
break;
|
||||
|
||||
case PPC_IFIDN:
|
||||
|
Loading…
x
Reference in New Issue
Block a user