From: Cyrill Gorcunov Date: Sun, 2 Oct 2011 05:18:34 +0000 (+0400) Subject: preproc: %ifenv should require environment variable name to exist X-Git-Tag: nasm-2.11.05~336 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6acada6f39d7305c20057119277aec17c1438d3d;p=platform%2Fupstream%2Fnasm.git preproc: %ifenv should require environment variable name to exist Otherwise naked %ifenv/%endif passes without a notice. Signed-off-by: Cyrill Gorcunov --- diff --git a/preproc.c b/preproc.c index 6360dcc..0085038 100644 --- a/preproc.c +++ b/preproc.c @@ -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: