summaryrefslogtreecommitdiff
path: root/data.c
diff options
context:
space:
mode:
authorGravatar default2022-10-05 12:08:17 +0200
committerGravatar default2022-10-05 12:08:17 +0200
commit3e2cfa48d9e8881cbb3c1934eb33d5c419a76211 (patch)
tree44250c4866a38276887d11b7722f215a49fbb40b /data.c
parentUpdated documentation. (diff)
downloadsnac2-3e2cfa48d9e8881cbb3c1934eb33d5c419a76211.tar.gz
snac2-3e2cfa48d9e8881cbb3c1934eb33d5c419a76211.tar.xz
snac2-3e2cfa48d9e8881cbb3c1934eb33d5c419a76211.zip
Alert if _timeline_find_fn() finds more than one file.
Diffstat (limited to 'data.c')
-rw-r--r--data.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/data.c b/data.c
index 23a82af..ba7e6fe 100644
--- a/data.c
+++ b/data.c
@@ -266,13 +266,19 @@ d_char *_timeline_find_fn(snac *snac, char *id)
266 xs *spec = xs_fmt("%s/timeline/" "*-%s.json", snac->basedir, md5); 266 xs *spec = xs_fmt("%s/timeline/" "*-%s.json", snac->basedir, md5);
267 xs *list = NULL; 267 xs *list = NULL;
268 d_char *fn = NULL; 268 d_char *fn = NULL;
269 int l;
269 270
270 list = xs_glob(spec, 0, 0); 271 list = xs_glob(spec, 0, 0);
272 l = xs_list_len(list);
271 273
272 /* if there is something, get the first one */ 274 /* if there is something, get the first one */
273 if (xs_list_len(list) > 0) 275 if (l > 0) {
274 fn = xs_str_new(xs_list_get(list, 0)); 276 fn = xs_str_new(xs_list_get(list, 0));
275 277
278 if (l > 1)
279 snac_log(snac, xs_fmt("**ALERT** _timeline_find_fn %d > 1", l));
280 }
281
276 return fn; 282 return fn;
277} 283}
278 284