avoid to copy the string even if solaris defines getenv to need a char* argument.

sayer/1.4-spce2.6
Raphael Coeffic 16 years ago
parent 2101331d13
commit 08f6326ac2

@ -1020,14 +1020,11 @@ void add_env_path(const char* name, const string& path)
{
string var(path);
char* old_path=0;
char name_s[50];
regex_t path_reg;
strcpy(name_s, name);
assert(name);
if((old_path = getenv(name_s)) != 0) {
if((old_path = getenv((char*)name)) != 0) {
if(strlen(old_path)){
if(regcomp(&path_reg,("[:|^]" + path + "[:|$]").c_str(),REG_NOSUB)){

Loading…
Cancel
Save