From 15dd5c0a5055d3db98fe6e98c7d2085d99c52804 Mon Sep 17 00:00:00 2001 From: Tilghman Lesher Date: Fri, 6 Jun 2008 17:34:21 +0000 Subject: For the purpose of making the changed syntax to ExecIf easier to transition, allow the deprecated syntax (fixed for jmls on -dev). git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@120904 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- apps/app_exec.c | 57 +++++++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 16 deletions(-) (limited to 'apps/app_exec.c') diff --git a/apps/app_exec.c b/apps/app_exec.c index 88c81822b..285b8b2f0 100644 --- a/apps/app_exec.c +++ b/apps/app_exec.c @@ -148,7 +148,7 @@ static int tryexec_exec(struct ast_channel *chan, void *data) static int execif_exec(struct ast_channel *chan, void *data) { int res = 0; - char *truedata = NULL, *falsedata = NULL, *end; + char *truedata = NULL, *falsedata = NULL, *end, *firstcomma, *firstquestion; struct ast_app *app = NULL; AST_DECLARE_APP_ARGS(expr, AST_APP_ARG(expr); @@ -160,24 +160,49 @@ static int execif_exec(struct ast_channel *chan, void *data) ); char *parse = ast_strdupa(data); - AST_NONSTANDARD_APP_ARGS(expr, parse, '?'); - if (ast_strlen_zero(expr.remainder)) { - ast_log(LOG_ERROR, "Usage: ExecIf(?()[:(?%s(%s))\n", depr.appname, depr.appargs); + + /* Make the two syntaxes look the same */ + expr.expr = depr.expr; + apps.t = depr.appname; + apps.f = NULL; + truedata = depr.appargs; + } else { + /* Preferred syntax */ + + AST_NONSTANDARD_APP_ARGS(expr, parse, '?'); + if (ast_strlen_zero(expr.remainder)) { + ast_log(LOG_ERROR, "Usage: ExecIf(?()[:(