diff options
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) | |||
| 496 | list = xs_list_new(); | 496 | list = xs_list_new(); |
| 497 | 497 | ||
| 498 | while (n < max && fgets(line, sizeof(line), f) != NULL) { | 498 | while (n < max && fgets(line, sizeof(line), f) != NULL) { |
| 499 | line[32] = '\0'; | 499 | if (line[0] != '-') { |
| 500 | list = xs_list_append(list, line); | 500 | line[32] = '\0'; |
| 501 | n++; | 501 | list = xs_list_append(list, line); |
| 502 | n++; | ||
| 503 | } | ||
| 502 | } | 504 | } |
| 503 | 505 | ||
| 504 | fclose(f); | 506 | fclose(f); |
| @@ -524,9 +526,11 @@ xs_list *index_list_desc(const char *fn, int skip, int show) | |||
| 524 | /* move to the end minus one entry (or more, if skipping entries) */ | 526 | /* move to the end minus one entry (or more, if skipping entries) */ |
| 525 | if (!fseek(f, 0, SEEK_END) && !fseek(f, (skip + 1) * -33, SEEK_CUR)) { | 527 | if (!fseek(f, 0, SEEK_END) && !fseek(f, (skip + 1) * -33, SEEK_CUR)) { |
| 526 | while (n < show && fgets(line, sizeof(line), f) != NULL) { | 528 | while (n < show && fgets(line, sizeof(line), f) != NULL) { |
| 527 | line[32] = '\0'; | 529 | if (line[0] != '-') { |
| 528 | list = xs_list_append(list, line); | 530 | line[32] = '\0'; |
| 529 | n++; | 531 | list = xs_list_append(list, line); |
| 532 | n++; | ||
| 533 | } | ||
| 530 | 534 | ||
| 531 | /* move backwards 2 entries */ | 535 | /* move backwards 2 entries */ |
| 532 | if (fseek(f, -66, SEEK_CUR) == -1) | 536 | 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 | |||
| 862 | 866 | ||
| 863 | if (del) { | 867 | if (del) { |
| 864 | ret = unlink(cfn); | 868 | ret = unlink(cfn); |
| 869 | index_del(idx, id); | ||
| 865 | } | 870 | } |
| 866 | else { | 871 | else { |
| 867 | if ((ret = link(ofn, cfn)) != -1) | 872 | if ((ret = link(ofn, cfn)) != -1) |