Module: sip-router
Branch: master
Commit: c0f87c06f60e2208f5e4421e9002f331cacb8a27
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=c0f87c0…
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
---
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;