settings: Allow empty strings in section key
This commit is contained in:
@@ -77,6 +77,8 @@ END_TEARDOWN
|
||||
START_TEST(test_get_str)
|
||||
{
|
||||
verify_string("val1", "main.key1");
|
||||
verify_string("val1", "main..key1");
|
||||
verify_string("val1", ".main.key1");
|
||||
verify_string("with spaces", "main.key2");
|
||||
verify_string("value", "main.sub1.key");
|
||||
verify_string("value2", "main.sub1.key2");
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2010 Tobias Brunner
|
||||
* Copyright (C) 2010-2014 Tobias Brunner
|
||||
* Copyright (C) 2008 Martin Willi
|
||||
* Hochschule fuer Technik Rapperswil
|
||||
*
|
||||
@@ -251,7 +251,11 @@ static section_t *find_section_buffered(section_t *section,
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
if (section->sections->find_first(section->sections,
|
||||
if (!strlen(buf))
|
||||
{
|
||||
found = section;
|
||||
}
|
||||
else if (section->sections->find_first(section->sections,
|
||||
(linked_list_match_t)section_find,
|
||||
(void**)&found, buf) != SUCCESS)
|
||||
{
|
||||
@@ -336,7 +340,11 @@ static kv_t *find_value_buffered(section_t *section, char *start, char *key,
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
if (section->sections->find_first(section->sections,
|
||||
if (!strlen(buf))
|
||||
{
|
||||
found = section;
|
||||
}
|
||||
else if (section->sections->find_first(section->sections,
|
||||
(linked_list_match_t)section_find,
|
||||
(void**)&found, buf) != SUCCESS)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user