diff options
author | Bill Hoffman <bill.hoffman@kitware.com> | 2004-01-26 18:32:46 (GMT) |
---|---|---|
committer | Bill Hoffman <bill.hoffman@kitware.com> | 2004-01-26 18:32:46 (GMT) |
commit | 222e9a2876fccaf5b7da399430b4ec0e4db5d4d4 (patch) | |
tree | c59ac6ae8d4ac8c5bd5f6417b8ce1f828c93039a /Source/cmCTest.cxx | |
parent | dd7f85a9dc791440b48138aecfff02fb934c1027 (diff) | |
download | CMake-222e9a2876fccaf5b7da399430b4ec0e4db5d4d4.zip CMake-222e9a2876fccaf5b7da399430b4ec0e4db5d4d4.tar.gz CMake-222e9a2876fccaf5b7da399430b4ec0e4db5d4d4.tar.bz2 |
BUG: fix put/get env problems
Diffstat (limited to 'Source/cmCTest.cxx')
-rw-r--r-- | Source/cmCTest.cxx | 20 |
1 files changed, 2 insertions, 18 deletions
diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx index 37ed8f8..c64211d 100644 --- a/Source/cmCTest.cxx +++ b/Source/cmCTest.cxx @@ -3019,28 +3019,12 @@ int cmCTest::RunConfigurationScript() // set any environment variables if (ctestEnv) { - static char ctestEnvStatic[100][5000]; std::vector<std::string> envArgs; cmSystemTools::ExpandListArgument(ctestEnv,envArgs); - int numArgs = envArgs.size(); - // we have a hard limit of 100 env args due to stupid format of putenv - if (numArgs > 100) - { - numArgs = 100; - } // for each variable/argument do a putenv - int i; - for (i = 0; i < numArgs; ++i) + for (unsigned i = 0; i < envArgs.size(); ++i) { - // also limit args to be at most 4K long - std::string::size_type size = envArgs[i].size(); - if(size > 4999) - { - size = 4999; - } - strncpy(ctestEnvStatic[i], envArgs[i].c_str(), size); - ctestEnvStatic[i][size] = 0; - putenv(ctestEnvStatic[i]); + cmSystemTools::PutEnv(envArgs[i].c_str()); } } |