handle file basename differently depending on prefix

cards etc were being stored in YYYYMM.json; now username.json
This commit is contained in:
Jan-Piet Mens
2015-08-15 08:15:01 +02:00
parent 8e9b463dd5
commit 42d03d8c13
+7 -2
View File
@@ -74,8 +74,13 @@ FILE *pathn(char *mode, char *prefix, UT_string *user, UT_string *device, char *
}
#endif
time(&now);
utstring_printf(path, "/%s.%s", yyyymm(now), suffix);
if (strcmp(prefix, "rec") == 0) {
time(&now);
utstring_printf(path, "/%s.%s", yyyymm(now), suffix);
} else {
utstring_printf(path, "/%s.%s",
utstring_body(user), suffix);
}
ut_clean(path);