]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/configparser.cpp
Change 2.0 cloak function to use variable-length segments
[user/henk/code/inspircd.git] / src / configparser.cpp
index 558c49117dd69ff6343015205c354c8a27e04af2..6b1b47e6de10f8417c41437e8a5ebe0d97245174 100644 (file)
@@ -76,7 +76,7 @@ struct Parser
                int ch = next();
                while (isspace(ch))
                        ch = next();
-               while (isalnum(ch) || ch == '_')
+               while (isalnum(ch) || ch == '_'|| ch == '-')
                {
                        rv.push_back(ch);
                        ch = next();
@@ -429,7 +429,14 @@ bool ConfigTag::getBool(const std::string &key, bool def)
        if(!readString(key, result))
                return def;
 
-       return (result == "yes" || result == "true" || result == "1" || result == "on");
+       if (result == "yes" || result == "true" || result == "1" || result == "on")
+               return true;
+       if (result == "no" || result == "false" || result == "0" || result == "off")
+               return false;
+
+       ServerInstance->Logs->Log("CONFIG",DEFAULT, "Value of <" + tag + ":" + key + "> at " + getTagLocation() +
+               " is not valid, ignoring");
+       return def;
 }
 
 std::string ConfigTag::getTagLocation()