Mercurial > paster
diff page-fork.c @ 78:9bfe5ce3cc45
pasterd: rework themes
author | David Demelier <markand@malikania.fr> |
---|---|
date | Thu, 16 Mar 2023 20:45:59 +0100 |
parents | 67b3d13a5035 |
children | 52029a52a385 |
line wrap: on
line diff
--- a/page-fork.c Thu Mar 16 15:05:26 2023 +0100 +++ b/page-fork.c Thu Mar 16 20:45:59 2023 +0100 @@ -19,21 +19,19 @@ #include <assert.h> #include "database.h" +#include "json-util.h" #include "page-new.h" #include "page.h" -#include "paste.h" static void get(struct kreq *req) { - struct paste paste = {0}; + json_t *paste; - if (!database_get(&paste, req->path)) + if (!(paste = database_get(req->path))) page_status(req, KHTTP_404); - else { - page_new_render(req, &paste); - paste_finish(&paste); - } + else + page_new_render(req, paste); } void