diff options
| author | 2010-03-09 19:37:23 -0600 | |
|---|---|---|
| committer | 2010-08-03 17:32:40 -0400 | |
| commit | 4dc31cdafcd70b279896369059a87f2162ea3cbb (patch) | |
| tree | 71bb5866a498249dcd477c31f93bc1c5221a27bf /src/configreader.cpp | |
| parent | Add interface user list to testnet check output (diff) | |
Complain when duplicate tags are found using ConfValue
Diffstat (limited to 'src/configreader.cpp')
| -rw-r--r-- | src/configreader.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/configreader.cpp b/src/configreader.cpp index 21625aa2c..017a59393 100644 --- a/src/configreader.cpp +++ b/src/configreader.cpp @@ -727,10 +727,15 @@ bool ServerConfig::StartsWithWindowsDriveLetter(const std::string &path) ConfigTag* ServerConfig::ConfValue(const std::string &tag) { - ConfigDataHash::iterator iter = config_data.find(tag); - if (iter == config_data.end()) + ConfigTagList found = config_data.equal_range(tag); + if (found.first == found.second) return NULL; - return iter->second; + ConfigTag* rv = found.first->second; + found.first++; + if (found.first != found.second) + ServerInstance->Logs->Log("CONFIG",DEFAULT, "Multiple <" + tag + "> tags found; only first will be used " + "(first at " + rv->getTagLocation() + "; second at " + found.first->second->getTagLocation() + ")"); + return rv; } ConfigTagList ServerConfig::ConfTags(const std::string& tag) |
