mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-03 11:25:35 +00:00
channels: Allow updating variable value
When modifying an already defined variable in some channel drivers they add a new variable with the same name to the list, but that value is never used, only the first one found. Introduce ast_variable_list_replace() and use it where appropriate. ASTERISK-23756 #close Patches: setvar-multiplie.patch submitted by Michael Goryainov Change-Id: Ie1897a96c82b8945e752733612ee963686f32839
This commit is contained in:
@@ -31366,8 +31366,10 @@ static struct ast_variable *add_var(const char *buf, struct ast_variable *list)
|
||||
if ((varval = strchr(varname, '='))) {
|
||||
*varval++ = '\0';
|
||||
if ((tmpvar = ast_variable_new(varname, varval, ""))) {
|
||||
tmpvar->next = list;
|
||||
list = tmpvar;
|
||||
if (ast_variable_list_replace(&list, tmpvar)) {
|
||||
tmpvar->next = list;
|
||||
list = tmpvar;
|
||||
}
|
||||
}
|
||||
}
|
||||
return list;
|
||||
|
Reference in New Issue
Block a user