summaryrefslogtreecommitdiff
path: root/cpp/src/Ice/PropertiesI.cpp
diff options
context:
space:
mode:
authorMark Spruiell <mes@zeroc.com>2002-03-27 18:48:15 +0000
committerMark Spruiell <mes@zeroc.com>2002-03-27 18:48:15 +0000
commit752a94844db64e0646f81b7dd1330e8c75d8c3d8 (patch)
tree15ac9618f935710539fe428325679a1c98d775ed /cpp/src/Ice/PropertiesI.cpp
parentadding Glacier test (diff)
downloadice-752a94844db64e0646f81b7dd1330e8c75d8c3d8.tar.bz2
ice-752a94844db64e0646f81b7dd1330e8c75d8c3d8.tar.xz
ice-752a94844db64e0646f81b7dd1330e8c75d8c3d8.zip
allow prefixes with multiple periods
Diffstat (limited to 'cpp/src/Ice/PropertiesI.cpp')
-rw-r--r--cpp/src/Ice/PropertiesI.cpp59
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)