mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-05 12:16:00 +00:00
Modifications to allow the output of SHELL() to be split per line (Issue 8676)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@49786 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -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 {
|
||||
|
Reference in New Issue
Block a user