aboutsummaryrefslogtreecommitdiff
path: root/src/env.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/env.c')
-rw-r--r--src/env.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/env.c b/src/env.c
index fcf8b49..a530a36 100644
--- a/src/env.c
+++ b/src/env.c
@@ -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;
}