diff options
author | Jose <jose@zeroc.com> | 2012-08-03 20:34:40 +0200 |
---|---|---|
committer | Jose <jose@zeroc.com> | 2012-08-03 20:34:40 +0200 |
commit | 33f3e7991be7e67bdf9fd1f68c64775710a87720 (patch) | |
tree | c0d14ae251e3c487401b34fb4688da2b81418565 /cpp/src/Ice/PropertiesI.cpp | |
parent | minor fix to TestUtil.py (diff) | |
download | ice-33f3e7991be7e67bdf9fd1f68c64775710a87720.tar.bz2 ice-33f3e7991be7e67bdf9fd1f68c64775710a87720.tar.xz ice-33f3e7991be7e67bdf9fd1f68c64775710a87720.zip |
ICE-4804 - Properties and case-mismatch
Diffstat (limited to 'cpp/src/Ice/PropertiesI.cpp')
-rw-r--r-- | cpp/src/Ice/PropertiesI.cpp | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/cpp/src/Ice/PropertiesI.cpp b/cpp/src/Ice/PropertiesI.cpp index fb2ca88bdb5..9bde5157184 100644 --- a/cpp/src/Ice/PropertiesI.cpp +++ b/cpp/src/Ice/PropertiesI.cpp @@ -171,9 +171,11 @@ Ice::PropertiesI::setProperty(const string& key, const string& value) // dot is an error. // assert(dotPos != string::npos); - + + bool mismatchCase = false; + string otherKey; string propPrefix = pattern.substr(0, dotPos); - if(propPrefix != prefix) + if(IceUtilInternal::toUpper(propPrefix) != IceUtilInternal::toUpper(prefix)) { continue; } @@ -193,11 +195,24 @@ Ice::PropertiesI::setProperty(const string& key, const string& value) currentKey = prop.deprecatedBy; } } + + if(!found && IceUtilInternal::match(IceUtilInternal::toUpper(currentKey), + IceUtilInternal::toUpper(prop.pattern))) + { + found = true; + mismatchCase = true; + otherKey = prop.pattern; + break; + } } if(!found) { logger->warning("unknown property: `" + currentKey + "'"); } + else if(mismatchCase) + { + logger->warning("unknown property: `" + currentKey + "'; did you mean `" + otherKey + "'"); + } } } |