Browse Source

textops(k): handle no match for subst transformation

Daniel-Constantin Mierla 14 năm trước cách đây
mục cha
commit
c0f87c06f6
1 tập tin đã thay đổi với 5 bổ sung0 xóa
  1. 5 0
      modules_k/textops/txt_var.c

+ 5 - 0
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;