From d50bab21d036edcc1d7b54b913cb422c3c2143e9 Mon Sep 17 00:00:00 2001 From: the little girl Date: Fri, 10 Jan 2014 16:34:42 +0100 Subject: ordentlig encoding --- config.def.h | 2 ++ wiki.c | 54 +++++++++++++++++++++++++++++++++++------------------- 2 files changed, 37 insertions(+), 19 deletions(-) diff --git a/config.def.h b/config.def.h index a83aa8e..ea4a312 100644 --- a/config.def.h +++ b/config.def.h @@ -1,6 +1,8 @@ static char *title = "a wiki"; static char *id = "anonymous"; +static char *loft = ".loft"; + static char *links[][2] = { { "home", "home" }, { "planer", "planer" }, diff --git a/wiki.c b/wiki.c index 5dc3c55..4dea629 100644 --- a/wiki.c +++ b/wiki.c @@ -3,6 +3,7 @@ #include #include #include +#include #include #include #include @@ -103,11 +104,10 @@ int unauthorized(int status) { int edit(char *path) { if(!writable(path)) return unauthorized(403); FILE *fp = fopen(path, "r"); - char *page = clean(path); fp ? head(path, path, "vis") : head(path, NULL, NULL); char buffer[sysconf(_SC_PAGESIZE)]; - printf("
\n"); - printf("