Do not crash if the environment variable is present but empty.

This commit is contained in:
nicm 2019-06-13 21:24:09 +00:00 committed by Nicholas Marriott
parent a924694820
commit 52b8274285

View File

@ -1112,7 +1112,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;
}