summaryrefslogtreecommitdiffstats
path: root/sm.c
diff options
context:
space:
mode:
authorErik K <erikk@previousplan.org>2022-05-26 16:31:27 +0000
committerErik K <erikk@previousplan.org>2022-05-26 16:31:27 +0000
commit61d75021c8a1180d2b591e70c783bd2eb21188bd (patch)
treee5401f7c66da4b41eb1bc7f01a8e98a38f8ceae8 /sm.c
parent9643e3cb444ee26088be4636ba2b753ac0166156 (diff)
mkdir parent directories when needed, also fixed bug in list().HEADmaster
Diffstat (limited to 'sm.c')
-rw-r--r--sm.c2
1 files changed, 2 insertions, 0 deletions
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);