diff options
author | Cyrill Gorcunov <gorcunov@gmail.com> | 2010-07-13 20:54:48 +0400 |
---|---|---|
committer | Cyrill Gorcunov <gorcunov@gmail.com> | 2010-07-13 21:17:49 +0400 |
commit | 41c5c6c36d36a1a111bdca5cdea198189142b4bb (patch) | |
tree | 25aa5d05a06fff4e0c59cb7c8b52ca4237c29c5e /preproc.c | |
parent | 6405229b6d45282dab81d1833bbdcf0e068ce56f (diff) | |
download | nasm-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>
Diffstat (limited to 'preproc.c')
-rw-r--r-- | preproc.c | 8 |
1 files changed, 3 insertions, 5 deletions
@@ -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 */ |