From 145005129ce5fbe8004abc0ab0d4b09949501572 Mon Sep 17 00:00:00 2001 From: Andrew Pamment Date: Wed, 7 Dec 2016 11:56:33 +1000 Subject: [PATCH] Forgot to delete temp directory --- files.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/files.c b/files.c index de1ece0..b493b27 100644 --- a/files.c +++ b/files.c @@ -237,7 +237,7 @@ char *get_file_id_diz(char *filename) { } snprintf(buffer, 1024, "%s/node%d/temp", conf.bbs_path, mynode); - if (stat(buffer, &s) != 0) { + if (stat(buffer, &s) == 0) { if (recursive_delete(buffer) != 0) { return NULL; @@ -297,6 +297,9 @@ char *get_file_id_diz(char *filename) { } description[bpos] = '\0'; + snprintf(buffer, 1024, "%s/node%d/temp", conf.bbs_path, mynode); + recursive_delete(buffer); + return description; }