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:
Cyrill Gorcunov 2011-10-02 09:18:34 +04:00
parent 4c6f82f78f
commit 6acada6f39

View File

@ -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: