summaryrefslogtreecommitdiff
path: root/cpp/src/IceGrid/Activator.cpp
diff options
context:
space:
mode:
authorDwayne Boone <dwayne@zeroc.com>2005-11-30 15:51:43 +0000
committerDwayne Boone <dwayne@zeroc.com>2005-11-30 15:51:43 +0000
commit893b14e8d56d4d79f1be80b5613c0f65c479dd3b (patch)
treead8bae0d44f9d0fef3859495ed257bf419cb6b7d /cpp/src/IceGrid/Activator.cpp
parentFixed bug 681 - --output-dir causing in include directives to change (diff)
downloadice-893b14e8d56d4d79f1be80b5613c0f65c479dd3b.tar.bz2
ice-893b14e8d56d4d79f1be80b5613c0f65c479dd3b.tar.xz
ice-893b14e8d56d4d79f1be80b5613c0f65c479dd3b.zip
Fixed bug 684 - environment variables on windows
Diffstat (limited to 'cpp/src/IceGrid/Activator.cpp')
-rw-r--r--cpp/src/IceGrid/Activator.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/cpp/src/IceGrid/Activator.cpp b/cpp/src/IceGrid/Activator.cpp
index b852e5de5b1..a3c3b804573 100644
--- a/cpp/src/IceGrid/Activator.cpp
+++ b/cpp/src/IceGrid/Activator.cpp
@@ -481,6 +481,8 @@ Activator::activate(const string& name,
//
// Create the environment block for the child process. We start with the environment
// of this process, and then merge environment variables from the server description.
+ // Since Windows is case insensitive wrt environment variables we convert the keys to
+ // uppercase to ensure matches are found.
//
const char* env = NULL;
string envbuf;
@@ -506,7 +508,9 @@ Activator::activate(const string& name,
string::size_type pos = s.find('=');
if(pos != string::npos)
{
- envMap.insert(map<string, string>::value_type(s.substr(0, pos), s.substr(pos + 1)));
+ string key = s.substr(0, pos);
+ std::transform(key.begin(), key.end(), key.begin(), toupper);
+ envMap.insert(map<string, string>::value_type(key, s.substr(pos + 1)));
}
var += s.size();
var++; // Skip the '\0' byte
@@ -518,7 +522,10 @@ Activator::activate(const string& name,
string::size_type pos = s.find('=');
if(pos != string::npos)
{
- envMap.insert(map<string, string>::value_type(s.substr(0, pos), s.substr(pos + 1)));
+ string key = s.substr(0, pos);
+ std::transform(key.begin(), key.end(), key.begin(), toupper);
+ envMap.erase(key);
+ envMap.insert(map<string, string>::value_type(key, s.substr(pos + 1)));
}
}
for(map<string, string>::const_iterator q = envMap.begin(); q != envMap.end(); ++q)