Module: sip-router
Branch: 3.1
Commit: 604db10f6d8f952ab0989f159f62ddab77059e1f
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=604db10…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: Sat Jan 29 00:36:52 2011 +0100
textops(k): handle no match for subst transformation
(cherry picked from commit c0f87c06f60e2208f5e4421e9002f331cacb8a27)
---
modules_k/textops/txt_var.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/modules_k/textops/txt_var.c b/modules_k/textops/txt_var.c
index 4de2f63..ae1fce6 100644
--- a/modules_k/textops/txt_var.c
+++ b/modules_k/textops/txt_var.c
@@ -64,6 +64,11 @@ int tr_txt_eval_re(struct sip_msg *msg, tr_param_t *tp, int subtype,
result=subst_str(tr_txt_buf, msg, se, &nmatches);
if (result == NULL)
{
+ if (nmatches==0)
+ {
+ LM_DBG("no match for subst expression\n");
+ return 0;
+ }
if (nmatches<0)
LM_ERR("subst failed\n");
return -1;