projects
/
monky
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d9f93d3
)
Fix: Templates only work when they end with a space or a }
author
Nikolas Garofil
<garo@dunaldi.garofil.be>
Mon, 23 Nov 2009 11:58:20 +0000
(12:58 +0100)
committer
Nikolas Garofil
<garo@dunaldi.garofil.be>
Mon, 23 Nov 2009 11:58:20 +0000
(12:58 +0100)
src/template.c
patch
|
blob
|
history
diff --git
a/src/template.c
b/src/template.c
index
4cbf21d
..
e20faf5
100644
(file)
--- 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;
}