Ver Fonte

cfg framework: apply the values in the order they are set

Add the value change to the end of the list (within the same group_id)
to make sure that the values are changed in the order they are set in the script.
This is important when the same variable is changed multiple times,
the latest value must be kept in this case.
Miklos Tirpak há 15 anos atrás
pai
commit
675f88e144
1 ficheiros alterados com 1 adições e 1 exclusões
  1. 1 1
      cfg/cfg_struct.c

+ 1 - 1
cfg/cfg_struct.c

@@ -948,7 +948,7 @@ int new_add_var(str *group_name, unsigned int group_id, str *var_name,
 
 	/* order the list by group_id, it will be easier to count the group instances */
 	for(	add_var_p = &group->add_var;
-		*add_var_p && ((*add_var_p)->group_id < group_id);
+		*add_var_p && ((*add_var_p)->group_id <= group_id);
 		add_var_p = &((*add_var_p)->next));
 
 	add_var->next = *add_var_p;