fixed a very minor parsing bug in plugins.ini
This commit is contained in:
parent
b4450bbee5
commit
36ec7bc818
|
@ -108,6 +108,17 @@ int CPluginMngr::loadPluginsFromFile(const char* filename)
|
||||||
|
|
||||||
line.clear();
|
line.clear();
|
||||||
line._fread(fp);
|
line._fread(fp);
|
||||||
|
/** quick hack */
|
||||||
|
char *ptr = const_cast<char *>(line.c_str());
|
||||||
|
while (*ptr)
|
||||||
|
{
|
||||||
|
if (*ptr == ';')
|
||||||
|
{
|
||||||
|
*ptr = '\0';
|
||||||
|
} else {
|
||||||
|
ptr++;
|
||||||
|
}
|
||||||
|
}
|
||||||
sscanf(line.c_str(), "%s %s", pluginName, debug);
|
sscanf(line.c_str(), "%s %s", pluginName, debug);
|
||||||
|
|
||||||
if (!isalnum(*pluginName))
|
if (!isalnum(*pluginName))
|
||||||
|
@ -607,6 +618,18 @@ void CPluginMngr::CALMFromFile(const char *file)
|
||||||
if (line[0] == ';' || line[0] == '\n' || line[0] == '\0')
|
if (line[0] == ';' || line[0] == '\n' || line[0] == '\0')
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
/** quick hack */
|
||||||
|
char *ptr = line;
|
||||||
|
while (*ptr)
|
||||||
|
{
|
||||||
|
if (*ptr == ';')
|
||||||
|
{
|
||||||
|
*ptr = '\0';
|
||||||
|
} else {
|
||||||
|
ptr++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
rline.assign(line);
|
rline.assign(line);
|
||||||
rline.trim();
|
rline.trim();
|
||||||
pluginName[0] = '\0';
|
pluginName[0] = '\0';
|
||||||
|
|
|
@ -477,10 +477,13 @@ int CheckModules(AMX *amx, char error[128])
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!found)
|
if (!found)
|
||||||
|
{
|
||||||
|
if ((expect != LibType_Library) || !LoadModule(buffer, PT_ANYTIME))
|
||||||
{
|
{
|
||||||
if (pHandler->HandleModule(buffer, (expect == LibType_Class)))
|
if (pHandler->HandleModule(buffer, (expect == LibType_Class)))
|
||||||
found = true;
|
found = true;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!found)
|
if (!found)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue
Block a user