saait

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

commit e5c7047c90f5f373c60ed5a1427077490f7e57de
parent 5198717e7a9842f53b36b75047e7e6f83162ff8c
Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date:   Mon,  5 Dec 2016 13:18:44 +0100

plop

Diffstat:
Msaait.c | 8+++-----
1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/saait.c b/saait.c @@ -97,7 +97,7 @@ readfile(const char *file) buf[len] = '\0'; } if (ferror(fp)) { - fprintf(stderr, "fread: file: %s %s\n", file, strerror(errno)); + fprintf(stderr, "fread: file: %s: %s\n", file, strerror(errno)); exit(1); } fclose(fp); @@ -391,10 +391,10 @@ main(int argc, char *argv[]) fprintf(stderr, "path truncated for file: '%s'\n", argv[i]); exit(1); } - /* set htmlfile if not set */ + /* set htmlfile, but allow to override it */ setvar(&c, newvar("htmlfile", htmlfile), 0); - /* set HTML output filename (with part removed), allow to override it. */ + /* set HTML output filename (with part removed), but allow to override it */ if ((p = strrchr(htmlfile, '/'))) setvar(&c, newvar("filename", &htmlfile[p - htmlfile + 1]), 0); else @@ -407,7 +407,6 @@ main(int argc, char *argv[]) for (j = 0; j < LEN(templates); j++) { /* TODO: page is a special case for now */ if (!strcmp(templates[j].name, "page")) { - /* output file */ r = snprintf(outputfile, sizeof(outputfile), "%s/%s", outputdir, v->value); if (r < 0 || (size_t)r >= sizeof(outputfile)) { fprintf(stderr, "path truncated: '%s/%s'\n", outputdir, v->value); @@ -420,7 +419,6 @@ main(int argc, char *argv[]) writepage(templates[j].fp, b->name, c, b->data); } fclose(templates[j].fp); - templates[j].fp = NULL; } else { b = &templates[j].blocks[BlockItem]; writepage(templates[j].fp, b->name, c, b->data);