From 9521d68bbf1687998a4364ffdf710cb9acad2ba2 Mon Sep 17 00:00:00 2001 From: Leo Tenenbaum Date: Thu, 4 Mar 2021 12:34:13 -0500 Subject: fix autocomplete if there is no tags file --- tags.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tags.c b/tags.c index ad95d4c..b6dc6ae 100644 --- a/tags.c +++ b/tags.c @@ -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); -- cgit v1.2.3