aboutsummaryrefslogtreecommitdiffstats
path: root/funcs/func_strings.c
diff options
context:
space:
mode:
authortilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2007-05-29 21:59:21 +0000
committertilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2007-05-29 21:59:21 +0000
commitdc2b8b66895c860a0d2bdf30269c2c4d8e7f3935 (patch)
treed6e77e8a40c6f36fa9bb3dce3263fe475d96a063 /funcs/func_strings.c
parentee230ebbff0c64186c8560296dc33378eebf29ea (diff)
Merged revisions 66538 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4 ................ r66538 | tilghman | 2007-05-29 16:56:07 -0500 (Tue, 29 May 2007) | 10 lines 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/trunk@66540 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'funcs/func_strings.c')
-rw-r--r--funcs/func_strings.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/funcs/func_strings.c b/funcs/func_strings.c
index f47e45db6..451c7b1f8 100644
--- a/funcs/func_strings.c
+++ b/funcs/func_strings.c
@@ -71,8 +71,12 @@ static int function_fieldqty(struct ast_channel *chan, const 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;
}