(svn r14167) -Fix: items in some ini-groups got duplicated on save.

This commit is contained in:
rubidium
2008-08-25 15:15:41 +00:00
parent 262ddecfc5
commit 621a9b647a
3 changed files with 10 additions and 20 deletions

View File

@@ -19,14 +19,6 @@ IniItem::IniItem(IniGroup *parent, const char *name, size_t len) : next(NULL), v
parent->last_item = &this->next;
}
IniItem::IniItem(IniGroup *parent, const char *name, const char *value) : next(NULL), comment(NULL)
{
this->name = strdup(name);
this->value = strdup(value);
*parent->last_item = this;
parent->last_item = &this->next;
}
IniItem::~IniItem()
{
free(this->name);
@@ -36,6 +28,12 @@ IniItem::~IniItem()
delete this->next;
}
void IniItem::SetValue(const char *value)
{
free(this->value);
this->value = strdup(value);
}
IniGroup::IniGroup(IniFile *parent, const char *name, size_t len) : next(NULL), type(IGT_VARIABLES), item(NULL), comment(NULL)
{
if (len == 0) len = strlen(name);