diff --git a/main.c b/main.c
index 0fe1108..5474da6 100644
--- a/main.c
+++ b/main.c
@@ -79,9 +79,7 @@ int findf(Lexicon* l, char* f) {
void fpedited(FILE* f, char* path) {
struct stat attr;
stat(path, &attr);
- fputs("", f);
- fprintf(f, "Edited on %s ", ctime(&attr.st_mtime));
- fputs("", f);
+ fprintf(f, "Edited on %s
", ctime(&attr.st_mtime));
}
int fpportal(FILE* f, Lexicon* l, char* s, int head) {
@@ -283,6 +281,34 @@ int fpinject(FILE* f, Lexicon* l, char* filepath) {
return 1;
}
+int fpfooter(FILE* f, char* name, char* path) {
+ if (!f || !name || !path)
+ return 0;
+ fputs("", f);
+ return 1;
+}
+
FILE* build(FILE* f, Lexicon* l, char* name, char* srcpath) {
if (!f)
return f;
@@ -333,16 +359,12 @@ FILE* build(FILE* f, Lexicon* l, char* name, char* srcpath) {
if (!fpinject(f, l, srcpath))
printf(">>> Building failed: %s\n", name);
fputs("\n\n", f);
- /* footer */
- fputs("", f);
}
+ /* footer */
+ if (!fpfooter(f, name, srcpath)) {
+ printf(">>> Building failed: footer(%s)\n", name);
+ }
+
/* end */
fputs("