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(). --- sm.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'sm.c') diff --git a/sm.c b/sm.c index 59e286e..d45ac85 100644 --- a/sm.c +++ b/sm.c @@ -339,6 +339,7 @@ edit(const char *filename) return 0; } snprintf(path, sizeof(path), "%s/%s", kcontentdir, filename); + mkparentdirs(path); switch ((pid = fork())) { case -1: fprintf(stderr, "fork: %s\n", strerror(errno)); @@ -362,6 +363,7 @@ list(const char *filename) plugstats[0] = '['; plugstats[NPLUGINS+1] = ']'; + plugstats[NPLUGINS+2] = '\0'; if (filename) { snprintf(path, sizeof(path), "%s/%s", kcontentdir, filename); cat(path, stdout); -- cgit v1.2.3