MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / cbm_unsetenv

Function cbm_unsetenv

src/foundation/compat.h:181–202  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

179 return status;
180}
181static inline int cbm_unsetenv(const char *name) {
182 if (!name) {
183 return EINVAL;
184 }
185 int name_chars = MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, name, -1, NULL, 0);
186 wchar_t *wide_name =
187 name_chars > 0 ? (wchar_t *)malloc((size_t)name_chars * sizeof(*wide_name)) : NULL;
188 if (!wide_name ||
189 MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, name, -1, wide_name, name_chars) <= 0) {
190 free(wide_name);
191 return EINVAL;
192 }
193 int status = _putenv_s(name, "");
194 if (status == 0) {
195 SetLastError(ERROR_SUCCESS);
196 if (!SetEnvironmentVariableW(wide_name, NULL) && GetLastError() != ERROR_ENVVAR_NOT_FOUND) {
197 status = EINVAL;
198 }
199 }
200 free(wide_name);
201 return status;
202}
203#else
204#define cbm_setenv setenv
205#define cbm_unsetenv unsetenv

Callers 15

worker_set_local_envFunction · 0.85
restore_test_envFunction · 0.85
test_cli.cFile · 0.85
cli_scope_fixture_finishFunction · 0.85
openhands_fixture_openFunction · 0.85
hl_run_hookFunction · 0.85
restore_envFunction · 0.85
git_env_hook_leaveFunction · 0.85

Calls

no outgoing calls

Tested by 15

restore_test_envFunction · 0.68
cli_scope_fixture_finishFunction · 0.68
openhands_fixture_openFunction · 0.68
hl_run_hookFunction · 0.68
restore_envFunction · 0.68
git_env_hook_leaveFunction · 0.68
tf_setup_cache_sentinelFunction · 0.68
extract_sql_fullFunction · 0.68
pf_env_startFunction · 0.68
pf_closeFunction · 0.68