Commit b9fc005 1 parent 0d549f8 commit b9fc005 Copy full SHA for b9fc005
File tree 1 file changed +4
-13
lines changed
1 file changed +4
-13
lines changed Original file line number Diff line number Diff line change @@ -144,20 +144,12 @@ EnvironmentMap env()
144
144
_inp.substr (_inp.find (' =' ) + 1 ));
145
145
};
146
146
147
+ char **currentEnv = nullptr ;
147
148
#ifdef _WIN32
148
- LPCH currentEnv = GetEnvironmentStrings ();
149
- if (currentEnv == nullptr )
150
- return {};
151
-
152
- LPCH env_var = currentEnv;
153
- while (*env_var != ' \0 ' )
154
- {
155
- ret.emplace (split (env_var));
156
- env_var += strlen (env_var) + 1 ;
157
- }
158
- FreeEnvironmentStrings (currentEnv);
149
+ currentEnv = *__p__environ ();
159
150
#else
160
- char **currentEnv = environ;
151
+ currentEnv = environ;
152
+ #endif
161
153
// In the case that clearenv() was just called
162
154
// currentEnv will be nullptr
163
155
if (currentEnv == nullptr )
@@ -167,7 +159,6 @@ EnvironmentMap env()
167
159
{
168
160
ret.emplace (split (*currentEnv));
169
161
}
170
- #endif
171
162
return ret;
172
163
}
173
164
You can’t perform that action at this time.
0 commit comments