mirror of
https://github.com/bkaradzic/bx.git
synced 2026-02-17 20:52:37 +01:00
Cleanup.
This commit is contained in:
@@ -70,12 +70,11 @@ const char* Settings::get(const StringView& _name) const
|
||||
FilePath uri(_name);
|
||||
const StringView path = strTrim(uri.getPath(), "/");
|
||||
const StringView& fileName = uri.getFileName();
|
||||
|
||||
int32_t section = INI_GLOBAL_SECTION;
|
||||
|
||||
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)
|
||||
{
|
||||
section = INI_GLOBAL_SECTION;
|
||||
@@ -103,10 +102,10 @@ void Settings::set(const StringView& _name, const StringView& _value)
|
||||
|
||||
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)
|
||||
{
|
||||
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() )
|
||||
{
|
||||
section = ini_find_section(ini, path.getPtr(), path.getLength()-1);
|
||||
section = ini_find_section(ini, path.getPtr(), path.getLength() );
|
||||
if (INI_NOT_FOUND == section)
|
||||
{
|
||||
section = INI_GLOBAL_SECTION;
|
||||
|
||||
Reference in New Issue
Block a user