automerge commit

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2-netsec@8172 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Automerge script
2006-01-18 02:00:34 +00:00
parent 396f6561a4
commit b0fd9f9b74
7 changed files with 31 additions and 24 deletions

View File

@@ -48,8 +48,12 @@ static char *function_fieldqty(struct ast_channel *chan, char *cmd, char *data,
if (delim) {
varname = strsep(&delim, "|");
pbx_retrieve_variable(chan, varname, &varval, workspace, sizeof(workspace), NULL);
while (strsep(&varval, delim))
fieldcount++;
if (delim) {
while (strsep(&varval, delim))
fieldcount++;
} else if (!ast_strlen_zero(varval)) {
fieldcount = 1;
}
snprintf(buf, len, "%d", fieldcount);
} else {
ast_log(LOG_ERROR, "Out of memory\n");