[sr-dev] git:tirpi/cfg_framework_multivalue: cfg framework: apply the values in the order they are set

Miklos Tirpak miklos at iptel.org
Wed Sep 29 16:56:29 CEST 2010


Module: sip-router
Branch: tirpi/cfg_framework_multivalue
Commit: 675f88e144fdcbe2f776b58e1f890f470e3d4bdb
URL:    http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=675f88e144fdcbe2f776b58e1f890f470e3d4bdb

Author: Miklos Tirpak <miklos at iptel.org>
Committer: Miklos Tirpak <miklos at iptel.org>
Date:   Wed Sep 29 13:58:07 2010 +0200

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.

---

 cfg/cfg_struct.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/cfg/cfg_struct.c b/cfg/cfg_struct.c
index 10d8ef7..358e4eb 100644
--- a/cfg/cfg_struct.c
+++ b/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;




More information about the sr-dev mailing list