Fixed bug with info database not reading back table properly

--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%40210
This commit is contained in:
David Anderson 2006-12-13 11:10:02 +00:00
parent 1ffa6eac9f
commit 36dc72cf04

View File

@ -69,14 +69,16 @@ unsigned int CPluginInfoDatabase::GetSettingsNum()
PluginSettings *CPluginInfoDatabase::GetSettingsIfMatch(unsigned int index, const char *filename) PluginSettings *CPluginInfoDatabase::GetSettingsIfMatch(unsigned int index, const char *filename)
{ {
BaseMemTable *memtab = m_strtab->GetMemTable(); BaseMemTable *memtab = m_strtab->GetMemTable();
PluginSettings *table = (PluginSettings *)memtab->GetAddress(m_infodb); int *table = (int *)memtab->GetAddress(m_infodb);
if (!table || index >= m_infodb_count) if (!table || index >= m_infodb_count)
{ {
return NULL; return NULL;
} }
const char *name = m_strtab->GetString(table[index].name); PluginSettings *plugin = (PluginSettings *)memtab->GetAddress(table[index]);
const char *name = m_strtab->GetString(plugin->name);
if (!name) if (!name)
{ {
@ -88,7 +90,7 @@ PluginSettings *CPluginInfoDatabase::GetSettingsIfMatch(unsigned int index, cons
return NULL; return NULL;
} }
return &table[index]; return plugin;
} }
void CPluginInfoDatabase::GetOptionsForPlugin(PluginSettings *settings, unsigned int opt_num, const char **key, const char **val) void CPluginInfoDatabase::GetOptionsForPlugin(PluginSettings *settings, unsigned int opt_num, const char **key, const char **val)
@ -189,7 +191,7 @@ SMCParseResult CPluginInfoDatabase::ReadSMC_LeavingSection()
{ {
if (in_plugins) if (in_plugins)
{ {
if (cur_plugin == -1) if (cur_plugin != -1)
{ {
if (in_options) if (in_options)
{ {