diff --git a/WHATS_NEW_DM b/WHATS_NEW_DM index 7de4785e2..49cc80e0f 100644 --- a/WHATS_NEW_DM +++ b/WHATS_NEW_DM @@ -1,5 +1,6 @@ Version 1.02.73 - ==================================== + Fix empty string warning logic in _find_config_str. (1.02.68) Fix dm_task_set_name to properly resolve path to dm name (1.02.71). Add dm_strncpy() function as a faster strncpy() replacement. diff --git a/libdm/libdm-config.c b/libdm/libdm-config.c index 97559171b..cd71f4e42 100644 --- a/libdm/libdm-config.c +++ b/libdm/libdm-config.c @@ -751,14 +751,16 @@ static const char *_find_config_str(const void *start, node_lookup_fn find_fn, { const struct dm_config_node *n = find_fn(start, path); - /* Empty strings are ignored */ - if ((n && n->v && n->v->type == DM_CFG_STRING) && - (allow_empty || (*n->v->v.str))) { - log_very_verbose("Setting %s to %s", path, n->v->v.str); - return n->v->v.str; - } else if (n && (!n->v || (n->v->type != DM_CFG_STRING) || - (!allow_empty && fail))) - log_warn("WARNING: Ignoring unsupported value for %s.", path); + /* Empty strings are ignored if allow_empty is set */ + if (n && n->v) { + if ((n->v->type == DM_CFG_STRING) && + (allow_empty || (*n->v->v.str))) { + log_very_verbose("Setting %s to %s", path, n->v->v.str); + return n->v->v.str; + } + if ((n->v->type != DM_CFG_STRING) || (!allow_empty && fail)) + log_warn("WARNING: Ignoring unsupported value for %s.", path); + } if (fail) log_very_verbose("%s not found in config: defaulting to %s",