| 381 | } |
| 382 | |
| 383 | void unset_env(environment_t *backup_env) |
| 384 | { |
| 385 | char **cur_env, **cur_env0; |
| 386 | int i; |
| 387 | |
| 388 | /* switch-over to backup environment */ |
| 389 | cur_env0=cur_env=environ; |
| 390 | environ=backup_env->env; |
| 391 | i=0; |
| 392 | /* release environment */ |
| 393 | while(*cur_env) { |
| 394 | /* leave previously existing vars alone */ |
| 395 | if (i>=backup_env->old_cnt) { |
| 396 | pkg_free(*cur_env); |
| 397 | } |
| 398 | cur_env++; |
| 399 | i++; |
| 400 | } |
| 401 | pkg_free(cur_env0); |
| 402 | pkg_free(backup_env); |
| 403 | } |
| 404 | |
| 405 | static int append_var(char *name, char *value, int len, struct hf_wrapper **list) |
| 406 | { |
no outgoing calls
no test coverage detected