diff options
Diffstat (limited to 'src/templating/mustach.c')
-rw-r--r-- | src/templating/mustach.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/templating/mustach.c b/src/templating/mustach.c index 548c38224..9f992c737 100644 --- a/src/templating/mustach.c +++ b/src/templating/mustach.c @@ -6,7 +6,9 @@ SPDX-License-Identifier: ISC */ +#ifndef _GNU_SOURCE #define _GNU_SOURCE +#endif #include <stdlib.h> #include <stdio.h> @@ -272,6 +274,7 @@ static int process(const char *template, size_t length, struct iwrap *iwrap, FIL template += l; stdalone = 1; pref.len = 0; + pref.prefix = prefix; } else if (!isspace(c)) { if (stdalone == 2 && enabled) { @@ -280,6 +283,7 @@ static int process(const char *template, size_t length, struct iwrap *iwrap, FIL return rc; pref.len = 0; stdalone = 0; + pref.prefix = NULL; } if (c == *opstr && end - beg >= (ssize_t)oplen) { for (l = 1 ; l < oplen && beg[l] == opstr[l] ; l++); @@ -360,6 +364,7 @@ get_name: if (rc < 0) return rc; pref.len = 0; + pref.prefix = NULL; } switch(c) { case '!': @@ -485,7 +490,7 @@ int mustach_file(const char *template, size_t length, const struct mustach_itf * /* process */ rc = itf->start ? itf->start(closure) : 0; if (rc == 0) - rc = process(template, length, &iwrap, file, 0); + rc = process(template, length, &iwrap, file, NULL); if (itf->stop) itf->stop(closure, rc); return rc; |