diff options
author | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-05-29 21:56:07 +0000 |
---|---|---|
committer | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-05-29 21:56:07 +0000 |
commit | eb9dff7553b0131509a2bcd79c2fb197d4b7b44e (patch) | |
tree | 31ba1e197fd08e7c72492a2129e116e139648387 /funcs/func_strings.c | |
parent | 26972b3c32ea861b42486fe89fda9880d7aec7bb (diff) |
Merged revisions 66537 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2
........
r66537 | tilghman | 2007-05-29 16:49:35 -0500 (Tue, 29 May 2007) | 2 lines
If the value of a variable passed to FIELDQTY is blank, then FIELDQTY should return 0, not 1.
........
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@66538 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'funcs/func_strings.c')
-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 e1808604b..3c8ead803 100644 --- a/funcs/func_strings.c +++ b/funcs/func_strings.c @@ -59,8 +59,12 @@ static int function_fieldqty(struct ast_channel *chan, char *cmd, sprintf(varsubst, "${%s}", args.varname); pbx_substitute_variables_helper(chan, varsubst, varval, sizeof(varval) - 1); - while (strsep(&varval2, args.delim)) - fieldcount++; + if (ast_strlen_zero(varval2)) + fieldcount = 0; + else { + while (strsep(&varval2, args.delim)) + fieldcount++; + } } else { fieldcount = 1; } |