From 36dc72cf04c9f97333ebcf4538045ca4ef18e0d5 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Wed, 13 Dec 2006 11:10:02 +0000 Subject: [PATCH] Fixed bug with info database not reading back table properly --HG-- extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%40210 --- core/systems/PluginInfoDatabase.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/core/systems/PluginInfoDatabase.cpp b/core/systems/PluginInfoDatabase.cpp index 03e43733..fb78b69d 100644 --- a/core/systems/PluginInfoDatabase.cpp +++ b/core/systems/PluginInfoDatabase.cpp @@ -69,14 +69,16 @@ unsigned int CPluginInfoDatabase::GetSettingsNum() PluginSettings *CPluginInfoDatabase::GetSettingsIfMatch(unsigned int index, const char *filename) { 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) { 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) { @@ -88,7 +90,7 @@ PluginSettings *CPluginInfoDatabase::GetSettingsIfMatch(unsigned int index, cons return NULL; } - return &table[index]; + return plugin; } 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 (cur_plugin == -1) + if (cur_plugin != -1) { if (in_options) {