Fixed a couple of glitches, added on/off values for boolean

This commit is contained in:
Marius Nita 2002-08-26 21:03:24 +00:00
parent ba1a71566b
commit 572acce581

View file

@ -77,7 +77,7 @@ bool Config::getValue(Config::BoolType type, bool &ret) const
BoolItemList::const_iterator it = bool_items.begin(), end = bool_items.end(); BoolItemList::const_iterator it = bool_items.begin(), end = bool_items.end();
for (; it != end; ++it) { for (; it != end; ++it) {
if ((*it)->type == type) { if ((*it)->type == type) {
ret = (*it)->type; ret = (*it)->value;
return true; return true;
} }
} }
@ -123,7 +123,8 @@ void Config::addOption(const std::string &name, const std::string &value)
item->type = bool_options[i].type; item->type = bool_options[i].type;
if (strcasecmp(tmp, "true") == 0 || strcasecmp(tmp, "1")) if (strcasecmp(tmp, "true") == 0 || strcasecmp(tmp, "1") == 0 ||
strcasecmp(tmp, "on") == 0)
item->value = true; item->value = true;
else else
item->value = false; item->value = false;