From 43e560788ad90c6bb2912dd44bfe8fe77fd2d91f Mon Sep 17 00:00:00 2001 From: Scoopta Date: Tue, 7 Jan 2020 18:08:55 -0800 Subject: [PATCH] Fixed keyword searching in drun --- modes/drun.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/modes/drun.c b/modes/drun.c index f05d5ce..cf5af29 100644 --- a/modes/drun.c +++ b/modes/drun.c @@ -64,7 +64,20 @@ static char* get_search_text(char* file) { const char* description = g_app_info_get_description(G_APP_INFO(info)); const char* categories = g_desktop_app_info_get_categories(info); const char* const* keywords = g_desktop_app_info_get_keywords(info); - return utils_concat(6, name, file, exec == NULL ? "" : exec, description == NULL ? "" : description, categories == NULL ? "" : categories, keywords == NULL ? (const char* const*) "" : keywords); + + char* keywords_str = strdup(""); + + if(keywords != NULL) { + for(size_t count = 0; keywords[count] != NULL; ++count) { + char* tmp = utils_concat(2, keywords_str, keywords[count]); + free(keywords_str); + keywords_str = tmp; + } + } + + char* ret = utils_concat(6, name, file, exec == NULL ? "" : exec, description == NULL ? "" : description, categories == NULL ? "" : categories, keywords_str); + free(keywords_str); + return ret; } static const gchar* const* get_actions(char* file, size_t* action_count) {