diff options
author | the little girl <yui@blekksprut.net> | 2014-01-09 21:12:12 +0100 |
---|---|---|
committer | the little girl <yui@blekksprut.net> | 2014-01-09 21:12:12 +0100 |
commit | abfb23091bd2306c87ebdc8ac31e1d72329d668e (patch) | |
tree | 0bac9300652f67ba9ae49721fa91837ae3ac4696 | |
parent | ad648f235d7643ff78c6eaaf9291ce5c96ac99ae (diff) | |
download | ukulele-abfb23091bd2306c87ebdc8ac31e1d72329d668e.tar.xz |
loft -> .loft
-rw-r--r-- | wiki.c | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -120,8 +120,12 @@ int edit(char *path) { return 0; } -char *loft = "loft"; -int store(char *id, char *data, int len) { +char *loft = ".loft"; +int store(char *raw, char *data, int len) { + char *dir = dirname(strdup(raw)); + char *id = basename(strdup(raw)); + if(chdir(dir)) + return problem(404, "Not found"); char path[strlen(id) + strlen(loft) + 256]; time_t epoch = time(NULL); snprintf(path, 512, "%s/%s.%d", loft, id, epoch); |