mirror of
https://github.com/asterisk/asterisk.git
synced 2026-07-27 16:07:15 -07:00
Optimize pbx_substitute_variables
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@87811 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
+6
-1
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user