| 152 | } |
| 153 | |
| 154 | static void GetAllEnvironments(std::map<std::string, std::string>* envs) |
| 155 | { |
| 156 | envs->clear(); |
| 157 | int i = 0; |
| 158 | while (environ[i]) { |
| 159 | char* env = environ[i]; |
| 160 | char* p = strchr(env, '='); |
| 161 | if (p) { |
| 162 | (*envs)[std::string(env, p)] = p + 1; |
| 163 | } |
| 164 | ++i; |
| 165 | } |
| 166 | } |
| 167 | |
| 168 | static void AppendEnvironments(std::map<std::string, std::string>* envs, |
| 169 | const std::map<std::string, std::string>& append, |