From: Tilghman Lesher Date: Tue, 29 May 2007 21:59:21 +0000 (+0000) Subject: Merged revisions 66538 via svnmerge from X-Git-Tag: 1.6.0-beta1~3^2~2551 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2baca1b2c5ebac54528455e207f4f92ddbcfc4aa;p=thirdparty%2Fasterisk.git 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: https://origsvn.digium.com/svn/asterisk/trunk@66540 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/funcs/func_strings.c b/funcs/func_strings.c index f47e45db6a..451c7b1f8f 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; }