From 42d03d8c134e238c5d71878d1b1fca64b200778e Mon Sep 17 00:00:00 2001 From: Jan-Piet Mens Date: Sat, 15 Aug 2015 08:15:01 +0200 Subject: [PATCH] handle file basename differently depending on prefix cards etc were being stored in YYYYMM.json; now username.json --- file.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/file.c b/file.c index 0c3b2ca..0f47fa0 100644 --- a/file.c +++ b/file.c @@ -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);