From: nishi Date: Mon, 29 Apr 2024 06:37:59 +0000 (+0000) Subject: windows sucks X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=b4d943287c45f2b1ae332f737f8b28f54755ab67;p=serenade.git windows sucks git-svn-id: file:///raid/svn-main/nishi-serenade/trunk@79 0f02c867-ac3d-714e-8a88-971ba1f6efcf --- diff --git a/Serenade/interpreter.c b/Serenade/interpreter.c index 3e1ae4c..f485d79 100644 --- a/Serenade/interpreter.c +++ b/Serenade/interpreter.c @@ -214,7 +214,7 @@ struct sn_interpreter_kv* sn_set_variable(struct sn_interpreter* sn, const char* if(!global) { for(i = 0; sn->local_variables[i] != NULL; i++) { if(strcmp(sn->local_variables[i]->key, name) == 0) { - sn->local_variables[i]->value = gen; + sn->local_variables[i]->value = sn_generic_dup(gen); replaced = true; return sn->local_variables[i]; } @@ -229,7 +229,7 @@ struct sn_interpreter_kv* sn_set_variable(struct sn_interpreter* sn, const char* } sn->local_variables[i] = malloc(sizeof(struct sn_generic)); sn->local_variables[i]->key = sn_strdup(name); - sn->local_variables[i]->value = gen; + sn->local_variables[i]->value = sn_generic_dup(gen); sn->local_variables[i]->handler = NULL; if(gen != NULL && gen->type == SN_TYPE_FUNCTION) sn->local_variables[i]->handler = gen->handler; sn->local_variables[i + 1] = NULL;