From d899a836b62b4163cabfb34b763de1246028ada3 Mon Sep 17 00:00:00 2001 From: Jordan Bancino Date: Thu, 2 Mar 2023 22:06:33 +0000 Subject: [PATCH] Apply #54 --- src/Db.c | 1 + src/Html.c | 5 ++--- src/Static/StaticLogin.c | 16 ++++++++++------ src/include/Html.h | 14 ++++++++++++++ 4 files changed, 27 insertions(+), 9 deletions(-) diff --git a/src/Db.c b/src/Db.c index d00b276..fcf0da8 100644 --- a/src/Db.c +++ b/src/Db.c @@ -832,6 +832,7 @@ DbList(Db * db, size_t nArgs,...) while ((file = readdir(files))) { size_t namlen = strlen(file->d_name); + if (namlen > 5) { int nameOffset = namlen - 5; diff --git a/src/Html.c b/src/Html.c index 21e6116..9d59c0f 100644 --- a/src/Html.c +++ b/src/Html.c @@ -46,9 +46,8 @@ HtmlBegin(FILE * stream, char *title) "%s | Telodendria" ,title ); - + HtmlBeginStyle(stream); fprintf(stream, - "" ); + HtmlEndStyle(stream); fprintf(stream, "" diff --git a/src/Static/StaticLogin.c b/src/Static/StaticLogin.c index fe97829..f59d7c0 100644 --- a/src/Static/StaticLogin.c +++ b/src/Static/StaticLogin.c @@ -38,22 +38,26 @@ StaticLogin(FILE * stream) "" "
" "" - "" - "" + "}"); + HtmlEndStyle(stream); + + fprintf(stream, "

" "" ); + HtmlBeginJs(stream); fprintf(stream, - "" ); + HtmlEndJs(stream); HtmlEnd(stream); } diff --git a/src/include/Html.h b/src/include/Html.h index 2bacf2d..48a5d84 100644 --- a/src/include/Html.h +++ b/src/include/Html.h @@ -26,6 +26,20 @@ #include +#define HtmlBeginJs(stream) fprintf(stream, \ + "") + +#define HtmlBeginStyle(stream) fprintf(stream, "") + extern void HtmlBegin(FILE *, char *);