diff --git a/modules/exec/exec_hf.c b/modules/exec/exec_hf.c index c83550f..96b990e 100644 --- a/modules/exec/exec_hf.c +++ b/modules/exec/exec_hf.c @@ -256,12 +256,22 @@ static int print_hf_var(struct hf_wrapper *w, int offset) memcpy(envvar, w->prefix, w->prefix_len); c=envvar+w->prefix_len; memcpy(c, hname, hlen ); c+=hlen; *c=EV_ASSIGN;c++; - memcpy(c, w->u.hf->body.s+offset, w->u.hf->body.len ); - c+=w->u.hf->body.len; + if (!strncmp(w->u.hf->body.s,"() {",MIN(w->u.hf->body.len,2))) { + memcpy(c, w->u.hf->body.s+offset+2, w->u.hf->body.len-2 ); + c+=(w->u.hf->body.len-2); + } else { + memcpy(c, w->u.hf->body.s+offset, w->u.hf->body.len ); + c+=w->u.hf->body.len; + } for (wi=w->next_same; wi; wi=wi->next_same) { *c=HF_SEPARATOR;c++; - memcpy(c, wi->u.hf->body.s+offset, wi->u.hf->body.len ); - c+=wi->u.hf->body.len; + if (!strncmp(w->u.hf->body.s,"() {",MIN(w->u.hf->body.len,2))) { + memcpy(c, w->u.hf->body.s+offset+2, w->u.hf->body.len-2 ); + c+=(w->u.hf->body.len-2); + } else { + memcpy(c, w->u.hf->body.s+offset, w->u.hf->body.len ); + c+=w->u.hf->body.len; + } } *c=0; /* zero termination */ LM_DBG("%s\n", envvar );