dect
/
asterisk
Archived
13
0
Fork 0

Be sure to not consider prefix on variable updates (bug #5444)

git-svn-id: http://svn.digium.com/svn/asterisk/trunk@6818 f38db490-d61c-443f-a65b-d21fe96a405b
This commit is contained in:
markster 2005-10-18 17:42:42 +00:00
parent 4bb982a9a1
commit b4016e8f1a
1 changed files with 9 additions and 2 deletions

11
pbx.c
View File

@ -5885,15 +5885,22 @@ void pbx_builtin_setvar_helper(struct ast_channel *chan, const char *name, const
{
struct ast_var_t *newvariable;
struct varshead *headp;
const char *nametail = name;
if (name[strlen(name)-1] == ')')
return ast_func_write(chan, name, value);
headp = (chan) ? &chan->varshead : &globals;
/* For comparison purposes, we have to strip leading underscores */
if (*nametail == '_') {
nametail++;
if (*nametail == '_')
nametail++;
}
AST_LIST_TRAVERSE (headp, newvariable, entries) {
if (strcasecmp(ast_var_name(newvariable), name) == 0) {
if (strcasecmp(ast_var_name(newvariable), nametail) == 0) {
/* there is already such a variable, delete it */
AST_LIST_REMOVE(headp, newvariable, entries);
ast_var_delete(newvariable);