summaryrefslogtreecommitdiff
path: root/upgrade.c
diff options
context:
space:
mode:
authordefault <nobody@localhost>2022-11-24 10:06:24 +0100
committerdefault <nobody@localhost>2022-11-24 10:06:24 +0100
commit4494fc3daf438733210ab3f20af5cd5492d60e2d (patch)
treedfbcb5790a7121f9c194e5a0324f0d845d2eb044 /upgrade.c
parente121aeb948280d3c519d2ae276dc71df88b90e4d (diff)
Fixed muted filenames.
Diffstat (limited to 'upgrade.c')
-rw-r--r--upgrade.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/upgrade.c b/upgrade.c
index 2473803..13f3fa1 100644
--- a/upgrade.c
+++ b/upgrade.c
@@ -84,9 +84,22 @@ int db_upgrade(d_char **error)
snac snac;
if (user_open(&snac, v)) {
+ char *p, *v;
xs *dir = xs_fmt("%s/hidden", snac.basedir);
+ /* create the hidden directory */
mkdir(dir, 0755);
+
+ /* rename all muted files incorrectly named .json */
+ xs *spec = xs_fmt("%s/muted/" "*.json", snac.basedir);
+ xs *fns = xs_glob(spec, 0, 0);
+
+ p = fns;
+ while (xs_list_iter(&p, &v)) {
+ xs *nfn = xs_replace(v, ".json", "");
+ rename(v, nfn);
+ }
+
user_free(&snac);
}
}