From 81b4308bde215f7f59c34977f037e9af798b5d69 Mon Sep 17 00:00:00 2001 From: Alasdair Kergon Date: Fri, 28 Apr 2006 13:30:59 +0000 Subject: [PATCH] Ignore empty strings in config files. --- WHATS_NEW | 1 + lib/config/config.c | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/WHATS_NEW b/WHATS_NEW index e5e3d0b93..1a4ba1094 100644 --- a/WHATS_NEW +++ b/WHATS_NEW @@ -1,5 +1,6 @@ Version 2.02.06 - ================================= + Ignore empty strings in config files. Require non-zero regionsize and document parameter on lvcreate man page. Invalidate cache if composition of VG changed externally. diff --git a/lib/config/config.c b/lib/config/config.c index 014a657bb..3b546fe96 100644 --- a/lib/config/config.c +++ b/lib/config/config.c @@ -752,9 +752,9 @@ const char *find_config_str(const struct config_node *cn, { const struct config_node *n = find_config_node(cn, path); - if (n && n->v->type == CFG_STRING) { - if (*n->v->v.str) - log_very_verbose("Setting %s to %s", path, n->v->v.str); + /* Empty strings are ignored */ + if ((n && n->v->type == CFG_STRING) && (*n->v->v.str)) + log_very_verbose("Setting %s to %s", path, n->v->v.str); return n->v->v.str; }