From d8987084b7aa3c47642af30a87c0673a2df01fd0 Mon Sep 17 00:00:00 2001 From: Alexander Pickering Date: Sat, 28 Sep 2019 15:28:23 -0400 Subject: Bugfix Fixed a bug where rendering a template multiple times would fail. --- src/ctemplates.c | 1 + t/test_1.c | 183 ++++++++++++------------------------------------------- 2 files changed, 39 insertions(+), 145 deletions(-) diff --git a/src/ctemplates.c b/src/ctemplates.c index d507d33..9a3b890 100644 --- a/src/ctemplates.c +++ b/src/ctemplates.c @@ -1250,6 +1250,7 @@ TMPL_render(struct TMPL_templates* t, struct TMPL_varlist* varlist, size_t* size free_tmpl_buf(t->out); } t->out = alloc_tmpl_buf(); + t->cursor = t->roottag; TMPL_render_helper(t,varlist); char* ret = bstringify(t->out,size_p); return ret; diff --git a/t/test_1.c b/t/test_1.c index 068197d..9412ce3 100644 --- a/t/test_1.c +++ b/t/test_1.c @@ -73,6 +73,15 @@ char t_18[] = "Test var with spaces between attribute and name: