From: Charlie Brej Date: Wed, 1 Jul 2009 09:06:43 +0000 (+0100) Subject: [script] Fix bug of assigning a var to itself (e.g. val = val;) X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=162ff81f0999f0da46b69a31363bf2dec3cbee3e;p=thirdparty%2Fplymouth.git [script] Fix bug of assigning a var to itself (e.g. val = val;) Problem was that the var is cleared before being re-assigned, which also clears the value we were about to write into it. --- diff --git a/src/plugins/splash/script/script-object.c b/src/plugins/splash/script/script-object.c index 110810be..15f68d17 100644 --- a/src/plugins/splash/script/script-object.c +++ b/src/plugins/splash/script/script-object.c @@ -378,6 +378,8 @@ void script_obj_assign (script_obj* obj_a, script_obj* obj_b) script_obj_reset (obj_a); obj_b = script_obj_deref_direct (obj_b); + if (obj_a == obj_b) return; + switch (obj_b->type){ case SCRIPT_OBJ_TYPE_NULL: obj_a->type = SCRIPT_OBJ_TYPE_NULL;