From 41c5c6c36d36a1a111bdca5cdea198189142b4bb Mon Sep 17 00:00:00 2001 From: Cyrill Gorcunov Date: Tue, 13 Jul 2010 20:54:48 +0400 Subject: BR3028880: Make nonexistent environment variable being fatal error Frank suggested to just print out an error if environment variable is not there. Agreed. Suggested-by: Frank Kotler Signed-off-by: Cyrill Gorcunov --- preproc.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/preproc.c b/preproc.c index 09ef32b6..570f9d11 100644 --- a/preproc.c +++ b/preproc.c @@ -1182,12 +1182,10 @@ static char *detoken(Token * tlist, bool expand_locals) if (t->type == TOK_PREPROC_ID && t->text[1] == '!') { char *p = getenv(t->text + 2); char *q = t->text; - if (p) { + if (p) t->text = nasm_strdup(p); - } else { - t->text = nasm_strdup(""); - error(ERR_WARNING | ERR_PASS1, "`%s' is empty", q + 2); - } + else + error(ERR_FATAL, "`%s' is empty", q + 2); nasm_free(q); } /* Expand local macros here and not during preprocessing */ -- cgit v1.2.1