From eef11b64e1a41db349b1a8a54b2f61e460483b07 Mon Sep 17 00:00:00 2001 From: nicm Date: Thu, 13 Jun 2019 21:24:09 +0000 Subject: [PATCH] Do not crash if the environment variable is present but empty. --- format.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; }