diff options
Diffstat (limited to 'cpp/src')
-rw-r--r-- | cpp/src/Ice/PropertiesI.cpp | 59 |
1 files changed, 33 insertions, 26 deletions
diff --git a/cpp/src/Ice/PropertiesI.cpp b/cpp/src/Ice/PropertiesI.cpp index 8f3767b2530..78cd88b4d18 100644 --- a/cpp/src/Ice/PropertiesI.cpp +++ b/cpp/src/Ice/PropertiesI.cpp @@ -180,32 +180,39 @@ Ice::PropertiesI::parseArgs(int& argc, char* argv[]) string::size_type beg = arg.find("--"); if (beg == 0) { - string::size_type end = arg.find('.'); - if (end != string::npos) - { - string prefix = arg.substr(2, end - 2); - - if (prefix == "Ice" || _argumentPrefixes.find(prefix) != _argumentPrefixes.end()) - { - match = true; - } - - if (match) - { - for (int i = idx ; i + 1 < argc ; ++i) - { - argv[i] = argv[i + 1]; - } - --argc; - - if (arg.find('=') == string::npos) - { - arg += "=1"; - } - - parseLine(arg.substr(2)); - } - } + string rest = arg.substr(2); + if (rest.find("Ice.") == 0) + { + match = true; + } + else + { + set<string>::const_iterator p; + for (p = _argumentPrefixes.begin(); p != _argumentPrefixes.end(); ++p) + { + if (rest.find((*p) + ".") == 0) + { + match = true; + break; + } + } + } + + if (match) + { + for (int i = idx ; i + 1 < argc ; ++i) + { + argv[i] = argv[i + 1]; + } + --argc; + + if (arg.find('=') == string::npos) + { + arg += "=1"; + } + + parseLine(arg.substr(2)); + } } if (!match) |