From c740ece288c3fb6f858a911222fd63caf95c4eea Mon Sep 17 00:00:00 2001 From: kartofen Date: Sun, 25 Aug 2024 15:46:56 +0300 Subject: lambda work, closures work, everything works --- src/env.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/env.c') 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; } -- cgit v1.2.3