1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-08-30 01:49:10 +00:00

(svn r14164) -Codechange: simplify and unify the addition of ini items with value when not loading an ini file.

-Fix: wrong insertion management causing leaks.
This commit is contained in:
rubidium
2008-08-25 06:35:28 +00:00
parent 6e4d8a273e
commit 411c65e755
3 changed files with 34 additions and 35 deletions

View File

@@ -19,6 +19,14 @@ 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);