]> git.ipfire.org Git - thirdparty/plymouth.git/commitdiff
[script] Fix bug of assigning a var to itself (e.g. val = val;)
authorCharlie Brej <cbrej@cs.man.ac.uk>
Wed, 1 Jul 2009 09:06:43 +0000 (10:06 +0100)
committerCharlie Brej <cbrej@cs.man.ac.uk>
Wed, 1 Jul 2009 09:06:43 +0000 (10:06 +0100)
Problem was that the var is cleared before being re-assigned, which also clears
the value we were about to write into it.

src/plugins/splash/script/script-object.c

index 110810be51bf4cabf0c8e6b9f20e983740fc25da..15f68d177fa576e3f93c8024136200581c68807a 100644 (file)
@@ -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;