saait

Simple static page generator
git clone https://git.sinitax.com/codemadness/saait
Log | Files | Refs | README | LICENSE | Upstream | sfeed.txt

commit be11bd1dda2a883fc861f6147167a3477b636fe7
parent 3d54db5f366efdf4612c9eaa537a22ad11035e45
Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date:   Tue, 29 Oct 2019 18:07:11 +0100

make sure util functions are at the top, move xmlencode before writepage()

Diffstat:
Msaait.c | 32++++++++++++++++----------------
1 file changed, 16 insertions(+), 16 deletions(-)

diff --git a/saait.c b/saait.c @@ -33,22 +33,6 @@ char *argv0; static struct variable *global; -/* Escape characters below as HTML 2.0 / XML 1.0. */ -void -xmlencode(const char *s, FILE *fp) -{ - for (; *s; s++) { - switch(*s) { - case '<': fputs("&lt;", fp); break; - case '>': fputs("&gt;", fp); break; - case '\'': fputs("&#39;", fp); break; - case '&': fputs("&amp;", fp); break; - case '"': fputs("&quot;", fp); break; - default: fputc(*s, fp); - } - } -} - char * estrdup(const char *s) { @@ -302,6 +286,22 @@ readconfig(const char *file) return c; } +/* Escape characters below as HTML 2.0 / XML 1.0. */ +void +xmlencode(const char *s, FILE *fp) +{ + for (; *s; s++) { + switch(*s) { + case '<': fputs("&lt;", fp); break; + case '>': fputs("&gt;", fp); break; + case '\'': fputs("&#39;", fp); break; + case '&': fputs("&amp;", fp); break; + case '"': fputs("&quot;", fp); break; + default: fputc(*s, fp); + } + } +} + void writepage(FILE *fp, const char *file, struct variable *c, char *s) {