Fix case sensitive variable resolution in in memory backend

Variables are case insensitive
This commit is contained in:
Felipe Zimmerle
2016-07-22 13:10:18 -03:00
parent 5d64f73817
commit f723870f18
3 changed files with 66 additions and 2 deletions

View File

@@ -99,7 +99,9 @@ void InMemoryPerProcess::resolveMultiMatches(const std::string& var,
if (x.first.at(keySize) != ':') {
continue;
}
if (x.first.compare(0, keySize, var) != 0) {
std::string fu = toupper(x.first);
std::string fvar = toupper(var);
if (fu.compare(0, keySize, fvar) != 0) {
continue;
}
l->insert(l->begin(), new Variable(x.first, x.second));

View File

@@ -59,7 +59,7 @@ struct MyHash{
// You might need a better hash function than this
size_t h = 0;
std::for_each(Keyval.begin(), Keyval.end(), [&](char c) {
h += c;
h += tolower(c);
});
return h;
}