|
@@ -70,12 +70,11 @@ const char* Settings::get(const StringView& _name) const
|
|
|
FilePath uri(_name);
|
|
FilePath uri(_name);
|
|
|
const StringView path = strTrim(uri.getPath(), "/");
|
|
const StringView path = strTrim(uri.getPath(), "/");
|
|
|
const StringView& fileName = uri.getFileName();
|
|
const StringView& fileName = uri.getFileName();
|
|
|
-
|
|
|
|
|
int32_t section = INI_GLOBAL_SECTION;
|
|
int32_t section = INI_GLOBAL_SECTION;
|
|
|
|
|
|
|
|
if (!path.isEmpty() )
|
|
if (!path.isEmpty() )
|
|
|
{
|
|
{
|
|
|
- section = ini_find_section(ini, path.getPtr(), path.getLength()-1);
|
|
|
|
|
|
|
+ section = ini_find_section(ini, path.getPtr(), path.getLength() );
|
|
|
if (INI_NOT_FOUND == section)
|
|
if (INI_NOT_FOUND == section)
|
|
|
{
|
|
{
|
|
|
section = INI_GLOBAL_SECTION;
|
|
section = INI_GLOBAL_SECTION;
|
|
@@ -103,10 +102,10 @@ void Settings::set(const StringView& _name, const StringView& _value)
|
|
|
|
|
|
|
|
if (!path.isEmpty() )
|
|
if (!path.isEmpty() )
|
|
|
{
|
|
{
|
|
|
- section = ini_find_section(ini, path.getPtr(), path.getLength()-1);
|
|
|
|
|
|
|
+ section = ini_find_section(ini, path.getPtr(), path.getLength() );
|
|
|
if (INI_NOT_FOUND == section)
|
|
if (INI_NOT_FOUND == section)
|
|
|
{
|
|
{
|
|
|
- section = ini_section_add(ini, path.getPtr(), path.getLength()-1);
|
|
|
|
|
|
|
+ section = ini_section_add(ini, path.getPtr(), path.getLength() );
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -146,7 +145,7 @@ void Settings::remove(const StringView& _name) const
|
|
|
|
|
|
|
|
if (!path.isEmpty() )
|
|
if (!path.isEmpty() )
|
|
|
{
|
|
{
|
|
|
- section = ini_find_section(ini, path.getPtr(), path.getLength()-1);
|
|
|
|
|
|
|
+ section = ini_find_section(ini, path.getPtr(), path.getLength() );
|
|
|
if (INI_NOT_FOUND == section)
|
|
if (INI_NOT_FOUND == section)
|
|
|
{
|
|
{
|
|
|
section = INI_GLOBAL_SECTION;
|
|
section = INI_GLOBAL_SECTION;
|