config file: only allow GlobalInitFile option to hooks block, one more error check
parent
52f205eb22
commit
cae23db783
|
@ -220,9 +220,18 @@ ConfigFile::getConfigFileInfo(const string &config_file)
|
||||||
trim(tokenizedLine.back());
|
trim(tokenizedLine.back());
|
||||||
|
|
||||||
if (inHooks)
|
if (inHooks)
|
||||||
{
|
|
||||||
if (!tokenizedLine.front().compare("GlobalInitFile"))
|
if (!tokenizedLine.front().compare("GlobalInitFile"))
|
||||||
|
if (global_init_file.empty())
|
||||||
global_init_file = tokenizedLine.back();
|
global_init_file = tokenizedLine.back();
|
||||||
|
else
|
||||||
|
{
|
||||||
|
cerr << "ERROR: May not have more than one GlobalInitFile option in [hooks] block." << endl;
|
||||||
|
exit(EXIT_FAILURE);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
cerr << "ERROR: Unrecognized option " << tokenizedLine.front() << " in [hooks] block." << endl;
|
||||||
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
if (!tokenizedLine.front().compare("Name"))
|
if (!tokenizedLine.front().compare("Name"))
|
||||||
|
|
Loading…
Reference in New Issue