From fe50c3c9389caf6989e35b09c2a171db59eb163f Mon Sep 17 00:00:00 2001 From: Bernard Normier Date: Thu, 3 Aug 2006 20:02:57 +0000 Subject: Fixed bugs #1284 and #1288 --- cpp/src/Ice/PropertiesI.cpp | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) (limited to 'cpp/src/Ice/PropertiesI.cpp') diff --git a/cpp/src/Ice/PropertiesI.cpp b/cpp/src/Ice/PropertiesI.cpp index 7030dd34114..e160fe6cf8f 100644 --- a/cpp/src/Ice/PropertiesI.cpp +++ b/cpp/src/Ice/PropertiesI.cpp @@ -178,6 +178,7 @@ Ice::PropertiesI::parseCommandLineOptions(const string& prefix, const StringSeq& for(i = 0; i < options.size(); i++) { string opt = options[i]; + if(opt.find(pfx) == 0) { if(opt.find('=') == string::npos) @@ -253,17 +254,22 @@ Ice::PropertiesI::PropertiesI(StringSeq& args, const PropertiesPtr& defaults, co } StringSeq::iterator q = args.begin(); - if(q != args.end()) + + if(_properties.find("Ice.ProgramName") == _properties.end()) { - // - // Use the first argument as the value for Ice.ProgramName. Replace - // any backslashes in this value with forward slashes, in case this - // value is used by the event logger. - // - string name = *q; - replace(name.begin(), name.end(), '\\', '/'); - setProperty("Ice.ProgramName", name); + if(q != args.end()) + { + // + // Use the first argument as the value for Ice.ProgramName. Replace + // any backslashes in this value with forward slashes, in case this + // value is used by the event logger. + // + string name = *q; + replace(name.begin(), name.end(), '\\', '/'); + setProperty("Ice.ProgramName", name); + } } + StringSeq tmp; bool loadConfigFiles = false; -- cgit v1.2.3