From 61d75021c8a1180d2b591e70c783bd2eb21188bd Mon Sep 17 00:00:00 2001 From: Erik K Date: Thu, 26 May 2022 16:31:27 +0000 Subject: mkdir parent directories when needed, also fixed bug in list(). --- skull.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'skull.c') diff --git a/skull.c b/skull.c index 5c44f20..4c66833 100644 --- a/skull.c +++ b/skull.c @@ -64,6 +64,8 @@ href=\"mailto:erikk@previousplan.org\">erikk@previousplan.org \ snprintf(path, sizeof(path), "%s/%s", kcontentdir, doc[i]->filename); snprintf(outpath, sizeof(outpath), "%s/%s", kskullexport, doc[i]->filename); + if (!mkparentdirs(outpath)) + continue; if ((outf = fopen(outpath, "w")) == NULL) { fprintf(stderr, "%s: %s\n", outpath, strerror(errno)); continue; -- cgit v1.2.3