aboutsummaryrefslogtreecommitdiff
path: root/src/env.c
diff options
context:
space:
mode:
authorkartofen <mladenovnasko0@gmail.com>2024-08-25 15:46:56 +0300
committerkartofen <mladenovnasko0@gmail.com>2024-08-25 15:46:56 +0300
commitc740ece288c3fb6f858a911222fd63caf95c4eea (patch)
tree860b3e15260b9f1cf6abc3c1f26d586c4ffdcd85 /src/env.c
parent54f071ac7d47ef515a3f6a4db9e83f2f9aca3c8c (diff)
lambda work, closures work, everything works
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;
}