Преглед на файлове

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 */
 	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;