From f6c57a72dcdd3a5ad0f4ac9a2e73245dc00a3abd Mon Sep 17 00:00:00 2001 From: Ben Winston Date: Sat, 11 May 2024 21:04:20 -0400 Subject: refactor: actually use the macro --- booki.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/booki.c b/booki.c index 7a91c7a..4c71100 100644 --- a/booki.c +++ b/booki.c @@ -347,13 +347,13 @@ char** search(int argc, char* argv[]) { field = search_opts.opts[i]; // compare fields - if (strcmp(field, "title") == 0) { + if (ATTR_MATCH(field, "title")) { if (!regex_match(search_opts.args[i], book->title)) break; - } else if (strcmp(field, "author") == 0) { + } else if (ATTR_MATCH(field, "author")) { if (!regex_match(search_opts.args[i], book->author)) break; - } else if (strcmp(field, "language") == 0) { + } else if (ATTR_MATCH(field, "language")) { if (!regex_match(search_opts.args[i], book->language)) break; } else { -- cgit v1.2.3