aboutsummaryrefslogtreecommitdiffstats
path: root/funcs/func_strings.c
diff options
context:
space:
mode:
authortilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2007-01-07 14:44:49 +0000
committertilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2007-01-07 14:44:49 +0000
commitd78e74ce7e376b55771b8933afd24f7cedfd2bd3 (patch)
tree50d16b12c128c8967f19903561eb4cce3feee13c /funcs/func_strings.c
parent11ebcfbc4a1cdb8f463df0c3e73311f0119aedf2 (diff)
Modifications to allow the output of SHELL() to be split per line (Issue 8676)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@49786 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'funcs/func_strings.c')
-rw-r--r--funcs/func_strings.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/funcs/func_strings.c b/funcs/func_strings.c
index 9f843b669..de87c197a 100644
--- a/funcs/func_strings.c
+++ b/funcs/func_strings.c
@@ -56,6 +56,16 @@ static int function_fieldqty(struct ast_channel *chan, const char *cmd,
AST_STANDARD_APP_ARGS(args, parse);
if (args.delim) {
pbx_retrieve_variable(chan, args.varname, &varval, buf, len, NULL);
+ if (args.delim[0] == '\\') {
+ if (args.delim[1] == 'n')
+ ast_copy_string(args.delim, "\n", 2);
+ else if (args.delim[1] == 't')
+ ast_copy_string(args.delim, "\t", 2);
+ else if (args.delim[1])
+ ast_copy_string(args.delim, &args.delim[1], 2);
+ else
+ ast_copy_string(args.delim, "-", 2);
+ }
while (strsep(&varval, args.delim))
fieldcount++;
} else {