From b2987b9354b6d9b44e5900a1fd0aa81306db26bf Mon Sep 17 00:00:00 2001 From: Nikolas Garofil Date: Mon, 23 Nov 2009 12:58:20 +0100 Subject: [PATCH] Fix: Templates only work when they end with a space or a } --- src/template.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/template.c b/src/template.c index 4cbf21d3..e20faf51 100644 --- a/src/template.c +++ b/src/template.c @@ -203,7 +203,7 @@ char *find_and_replace_templates(const char *inbuf) if (!(*p)) break; - if (strncmp(p, "$template", 9) && strncmp(p, "${template", 10)) { + if (strncmp(p, "$template", strlen("$template")) && strncmp(p, "${template", strlen("${template"))) { *(o++) = *(p++); continue; } @@ -235,7 +235,8 @@ char *find_and_replace_templates(const char *inbuf) } } else { templ = p + 1; - while (*p && !isspace(*p)) + p += strlen("$template"); + while (*p && isdigit(*p)) p++; args = NULL; }