diff options
author | Tilghman Lesher <tilghman@meg.abyt.es> | 2006-01-14 19:08:03 +0000 |
---|---|---|
committer | Tilghman Lesher <tilghman@meg.abyt.es> | 2006-01-14 19:08:03 +0000 |
commit | 3578c5b19d9108116577c76ad7605a75db1bc57d (patch) | |
tree | 33d07c82c792006d5c8281cff3a253fa402b4901 | |
parent | c4d3efb519311320044903cf2e2b4b680cb75e59 (diff) |
Merged revisions 8074 via svnmerge from
/branches/1.2
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@8075 65c4cc65-6c06-0410-ace0-fbb531ad65f3
-rw-r--r-- | funcs/func_strings.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/funcs/func_strings.c b/funcs/func_strings.c index bce5d9d62..414adf36b 100644 --- a/funcs/func_strings.c +++ b/funcs/func_strings.c @@ -50,8 +50,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"); |