diff options
author | Leo Tenenbaum <pommicket@gmail.com> | 2021-03-04 12:34:13 -0500 |
---|---|---|
committer | Leo Tenenbaum <pommicket@gmail.com> | 2021-03-04 12:34:13 -0500 |
commit | 9521d68bbf1687998a4364ffdf710cb9acad2ba2 (patch) | |
tree | 13f012a1de91ef3d4d05048bdf653e71fbf81989 | |
parent | cebc5533d7704bdfc7b8dc0bf9dbdb6755685211 (diff) |
fix autocomplete if there is no tags file
-rw-r--r-- | tags.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -46,9 +46,10 @@ static int tag_try(FILE *fp, char const *tag) { // each element in out should be freed when you're done with them size_t tags_beginning_with(Ted *ted, char const *prefix, char **out, size_t out_size) { assert(out_size); - - FILE *file = fopen(tags_filename(ted), "rb"); - if (!file) return false; + char const *tags_name = tags_filename(ted); + if (!tags_name) return 0; + FILE *file = fopen(tags_name, "rb"); + if (!file) return 0; fseek(file, 0, SEEK_END); size_t file_size = (size_t)ftell(file); |