summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCyrill Gorcunov <gorcunov@gmail.com>2010-07-13 20:54:48 +0400
committerCyrill Gorcunov <gorcunov@gmail.com>2010-07-13 21:17:49 +0400
commit41c5c6c36d36a1a111bdca5cdea198189142b4bb (patch)
tree25aa5d05a06fff4e0c59cb7c8b52ca4237c29c5e
parent6405229b6d45282dab81d1833bbdcf0e068ce56f (diff)
downloadnasm-41c5c6c36d36a1a111bdca5cdea198189142b4bb.tar.gz
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 <fbkotler@zytor.com> Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
-rw-r--r--preproc.c8
1 files 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 */