summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornicm <nicm>2019-06-13 21:24:09 +0000
committernicm <nicm>2019-06-13 21:24:09 +0000
commiteef11b64e1a41db349b1a8a54b2f61e460483b07 (patch)
treeec5ad9a331265b33fe1cda89b53e9e9a715d7b43
parentb8a9c740bbb0f28ce7cbfeeec584e0719950b8a8 (diff)
Do not crash if the environment variable is present but empty.
-rw-r--r--format.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/format.c b/format.c
index c2a911f8..e1a6360a 100644
--- a/format.c
+++ b/format.c
@@ -1097,7 +1097,7 @@ format_find(struct format_tree *ft, const char *key, int modifiers)
envent = environ_find(ft->s->environ, key);
if (envent == NULL)
envent = environ_find(global_environ, key);
- if (envent != NULL) {
+ if (envent != NULL && envent->value != NULL) {
found = xstrdup(envent->value);
goto found;
}