| 166 | } |
| 167 | |
| 168 | static void AppendEnvironments(std::map<std::string, std::string>* envs, |
| 169 | const std::map<std::string, std::string>& append, |
| 170 | bool overwrite) |
| 171 | { |
| 172 | if (overwrite) { |
| 173 | for (std::map<std::string, std::string>::const_iterator i = append.begin(); |
| 174 | i != append.end(); ++i) { |
| 175 | (*envs)[i->first] = i->second; |
| 176 | } |
| 177 | } else { |
| 178 | envs->insert(append.begin(), append.end()); |
| 179 | } |
| 180 | } |
| 181 | |
| 182 | static void EnvironmentsToStringVector( |
| 183 | const std::map<std::string, std::string>& envs, |