diff options
author | om <om@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-04-04 06:21:14 +0000 |
---|---|---|
committer | om <om@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-04-04 06:21:14 +0000 |
commit | b68b58fabafa0c08cab640142f02c323b403f712 (patch) | |
tree | 9e81a5c515088345dbcc9bfb61ca5d76a5ad67c7 /src/inspircd_io.cpp | |
parent | ea1a5c17b5e79c0132da28a75fe42159deebf737 (diff) |
Undo the last tweak, which broke it, and show filenames in the error messages
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@3820 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/inspircd_io.cpp')
-rw-r--r-- | src/inspircd_io.cpp | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/src/inspircd_io.cpp b/src/inspircd_io.cpp index edb9702ab..76c1429e1 100644 --- a/src/inspircd_io.cpp +++ b/src/inspircd_io.cpp @@ -1042,10 +1042,7 @@ bool ServerConfig::LoadConf(ConfigDataHash &target, const char* filename, std::o */ if((ch == '#') && !in_quote) - { in_comment = true; - continue; - } switch(ch) { @@ -1059,6 +1056,9 @@ bool ServerConfig::LoadConf(ConfigDataHash &target, const char* filename, std::o ch = ' '; } + if(in_comment) + continue; + line += ch; if(ch == '<') @@ -1067,7 +1067,7 @@ bool ServerConfig::LoadConf(ConfigDataHash &target, const char* filename, std::o { if(!in_quote) { - errorstream << "Got another opening < when the first one wasn't closed on line " << linenumber << std::endl; + errorstream << "Got another opening < when the first one wasn't closed: " << filename << ":" << linenumber << std::endl; return false; } } @@ -1075,7 +1075,7 @@ bool ServerConfig::LoadConf(ConfigDataHash &target, const char* filename, std::o { if(in_quote) { - errorstream << "We're in a quote but outside a tag, interesting. Line: " << linenumber << std::endl; + errorstream << "We're in a quote but outside a tag, interesting. " << filename << ":" << linenumber << std::endl; return false; } else @@ -1104,11 +1104,11 @@ bool ServerConfig::LoadConf(ConfigDataHash &target, const char* filename, std::o { if(in_quote) { - errorstream << "Found a (closing) \" outside a tag on line " << linenumber << std::endl; + errorstream << "Found a (closing) \" outside a tag: " << filename << ":" << linenumber << std::endl; } else { - errorstream << "Found a (opening) \" outside a tag on line " << linenumber << std::endl; + errorstream << "Found a (opening) \" outside a tag: " << filename << ":" << linenumber << std::endl; } } } @@ -1133,7 +1133,7 @@ bool ServerConfig::LoadConf(ConfigDataHash &target, const char* filename, std::o } else { - errorstream << "Got a closing > when we weren't inside a tag on line " << linenumber << std::endl; + errorstream << "Got a closing > when we weren't inside a tag: " << filename << ":" << linenumber << std::endl; return false; } } @@ -1160,7 +1160,7 @@ bool ServerConfig::ParseLine(ConfigDataHash &target, std::string &line, long lin got_name = got_key = in_quote = false; - std::cout << "ParseLine(data, '" << line << "', " << linenumber << ", stream)" << std::endl; + // std::cout << "ParseLine(data, '" << line << "', " << linenumber << ", stream)" << std::endl; for(std::string::iterator c = line.begin(); c != line.end(); c++) { @@ -1243,8 +1243,6 @@ bool ServerConfig::ParseLine(ConfigDataHash &target, std::string &line, long lin /* Finished parsing the tag, add it to the config hash */ target.insert(std::pair<std::string, KeyValList > (tagname, results)); - std::cout << "Finished parsing " << tagname << std::endl; - std::cout << "Count of <server> tag: " << target.count("server") << std::endl; return true; } @@ -1312,7 +1310,7 @@ bool ServerConfig::ConfValue(ConfigDataHash &target, const std::string &tag, con } else { - log(DEBUG, "ConfValue got an out-of-range index %d", index); + log(DEBUG, "ConfValue got an out-of-range index %d", pos); } return false; @@ -1378,7 +1376,7 @@ int ServerConfig::ConfVarEnum(ConfigDataHash &target, const std::string &tag, in } else { - log(DEBUG, "ConfVarEnum got an out-of-range index %d", index); + log(DEBUG, "ConfVarEnum got an out-of-range index %d", pos); } return 0; |