Skip to content
Snippets Groups Projects
Commit 00d3c314 authored by Kevin P. Fleming's avatar Kevin P. Fleming
Browse files

issue #5585

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@7012 65c4cc65-6c06-0410-ace0-fbb531ad65f3
parent a0a97696
No related branches found
No related tags found
No related merge requests found
2005-11-07 Kevin P. Fleming <kpfleming@digium.com> 2005-11-07 Kevin P. Fleming <kpfleming@digium.com>
* manager.c (astman_get_variables): restore old multiple-variable behavior for "Variable" header (issue #5585)
* many files: don't check for NULL before calling ast_strlen_zero, it can do it itself (issue #5648) * many files: don't check for NULL before calling ast_strlen_zero, it can do it itself (issue #5648)
* pbx.c (handle_show_hints): use proper state-to-string function for hint state (issue #5583) * pbx.c (handle_show_hints): use proper state-to-string function for hint state (issue #5583)
......
...@@ -309,26 +309,34 @@ char *astman_get_header(struct message *m, char *var) ...@@ -309,26 +309,34 @@ char *astman_get_header(struct message *m, char *var)
struct ast_variable *astman_get_variables(struct message *m) struct ast_variable *astman_get_variables(struct message *m)
{ {
int varlen, x; int varlen, x, y;
struct ast_variable *head = NULL, *cur; struct ast_variable *head = NULL, *cur;
char *var, *val; char *var, *val;
unsigned int var_count;
char *vars[32];
varlen = strlen("Variable: "); varlen = strlen("Variable: ");
for (x = 0; x < m->hdrcount; x++) { for (x = 0; x < m->hdrcount; x++) {
if (!strncasecmp("Variable: ", m->headers[x], varlen)) { if (strncasecmp("Variable: ", m->headers[x], varlen))
var = val = ast_strdupa(m->headers[x] + varlen); continue;
if (!var)
return head; if (!(var = ast_strdupa(m->headers[x] + varlen)))
strsep(&val, "="); return head;
if (!val || ast_strlen_zero(var))
continue; if ((var_count = ast_app_separate_args(var, '|', vars, sizeof(vars) / sizeof(var[0])))) {
cur = ast_variable_new(var, val); for (y = 0; y < var_count; y++) {
if (head) { var = val = vars[y];
cur->next = head; strsep(&val, "=");
head = cur; if (!val || ast_strlen_zero(var))
} else continue;
head = cur; cur = ast_variable_new(var, val);
if (head) {
cur->next = head;
head = cur;
} else
head = cur;
}
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment