浏览代码

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 15 年之前
父节点
当前提交
675f88e144
共有 1 个文件被更改,包括 1 次插入1 次删除
  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 */
 	/* order the list by group_id, it will be easier to count the group instances */
 	for(	add_var_p = &group->add_var;
 	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_p = &((*add_var_p)->next));
 
 
 	add_var->next = *add_var_p;
 	add_var->next = *add_var_p;