diff options
author | default <nobody@localhost> | 2023-07-05 09:51:45 +0200 |
---|---|---|
committer | default <nobody@localhost> | 2023-07-05 09:51:45 +0200 |
commit | 8faa06652d8fd1bbbd1139170b7892b6d81d0927 (patch) | |
tree | ee656804e6d3c04b48a9f3bffa8c425701aeac57 /data.c | |
parent | c47df7634e693736c31a446bb432fc036ead0513 (diff) | |
parent | 38ee86f81e74edec97bf04d999d21221565f44fb (diff) |
Merge branch 'master' of triptico.com:git/snac2
Diffstat (limited to 'data.c')
-rw-r--r-- | data.c | 17 |
1 files changed, 11 insertions, 6 deletions
@@ -496,9 +496,11 @@ xs_list *index_list(const char *fn, int max) list = xs_list_new(); while (n < max && fgets(line, sizeof(line), f) != NULL) { - line[32] = '\0'; - list = xs_list_append(list, line); - n++; + if (line[0] != '-') { + line[32] = '\0'; + list = xs_list_append(list, line); + n++; + } } fclose(f); @@ -524,9 +526,11 @@ xs_list *index_list_desc(const char *fn, int skip, int show) /* move to the end minus one entry (or more, if skipping entries) */ if (!fseek(f, 0, SEEK_END) && !fseek(f, (skip + 1) * -33, SEEK_CUR)) { while (n < show && fgets(line, sizeof(line), f) != NULL) { - line[32] = '\0'; - list = xs_list_append(list, line); - n++; + if (line[0] != '-') { + line[32] = '\0'; + list = xs_list_append(list, line); + n++; + } /* move backwards 2 entries */ if (fseek(f, -66, SEEK_CUR) == -1) @@ -862,6 +866,7 @@ int _object_user_cache(snac *snac, const char *id, const char *cachedir, int del if (del) { ret = unlink(cfn); + index_del(idx, id); } else { if ((ret = link(ofn, cfn)) != -1) |