diff options
author | Tilghman Lesher <tilghman@meg.abyt.es> | 2007-10-31 15:46:41 +0000 |
---|---|---|
committer | Tilghman Lesher <tilghman@meg.abyt.es> | 2007-10-31 15:46:41 +0000 |
commit | b6ec3509104e20a196dce2c371d3ec728b7f4200 (patch) | |
tree | f8527fb65919a35b5214bcc60d6148171458d3cc /main | |
parent | 8c5bf67f4af93977de77299bf76e6a757c0f4434 (diff) |
Optimize pbx_substitute_variables
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@87811 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main')
-rw-r--r-- | main/pbx.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/main/pbx.c b/main/pbx.c index aecaa13eb..d40828707 100644 --- a/main/pbx.c +++ b/main/pbx.c @@ -1819,10 +1819,15 @@ void pbx_substitute_variables_varshead(struct varshead *headp, const char *cp1, static void pbx_substitute_variables(char *passdata, int datalen, struct ast_channel *c, struct ast_exten *e) { + const char *tmp; memset(passdata, 0, datalen); + /* Nothing more to do */ + if (!e->data) + return; + /* No variables or expressions in e->data, so why scan it? */ - if (e->data && !strchr(e->data, '$') && !strstr(e->data,"${") && !strstr(e->data,"$[") && !strstr(e->data,"$(")) { + if ((!(tmp = strchr(e->data, '$'))) || (!strstr(tmp, "${") && !strstr(tmp, "$["))) { ast_copy_string(passdata, e->data, datalen); return; } |