diff options
Diffstat (limited to 'src/env.c')
-rw-r--r-- | src/env.c | 7 |
1 files changed, 3 insertions, 4 deletions
@@ -64,11 +64,10 @@ void env_destroy(env_t env) env_t env_copy(env_t env) { - env->refs++; + if(env == ENV_EMPTY) return ENV_EMPTY; - if(env->parent) { - env_copy(env->parent); - } + env->refs++; + env_copy(env->parent); return env; } |