Module: sip-router Branch: 3.1 Commit: 840ca4db6726a1498901b75763bf5ef565fd8fb3 URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=840ca4db...
Author: Daniel-Constantin Mierla miconda@gmail.com Committer: Daniel-Constantin Mierla miconda@gmail.com Date: Fri Oct 15 11:19:18 2010 +0200
core: apply all subst pre-processor directives
- previously first applied subst stopped the processes - reported by Alex Balashov (cherry picked from commit a423e3141332f40fec07da1efe9f5e227fff0061)
---
ppcfg.c | 10 +++++++--- 1 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/ppcfg.c b/ppcfg.c index 8830f71..30754d4 100644 --- a/ppcfg.c +++ b/ppcfg.c @@ -83,6 +83,7 @@ int pp_subst_run(char **data) { str* result; pp_subst_rule_t *pr; + int i;
if(pp_subst_rules_head==NULL) return 0; @@ -93,22 +94,25 @@ int pp_subst_run(char **data) return 0; pr = pp_subst_rules_head;
+ i = 0; while(pr) { result=subst_str(*data, 0, (struct subst_expr*)pr->ppdata, 0); /* pkg malloc'ed result */ if(result!=NULL) { - LM_DBG("### preprocess subst applied to [%s]" - " - returning new string [%s]\n", *data, result->s); + i++; + LM_DBG("preprocess subst applied [#%d] to [%s]" + " - returning new string [%s]\n", i, *data, result->s); pkg_free(*data); *data = result->s; pkg_free(result); - return 1; } pr = pr->next; }
+ if(i!=0) + return 1; return 0; }