aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Winston2024-05-11 21:04:20 -0400
committerBen Winston2024-05-11 21:04:20 -0400
commitf6c57a72dcdd3a5ad0f4ac9a2e73245dc00a3abd (patch)
tree14cf2246eda3c9593111b8aefe7debd0ff6e33b8
parent9923100cba261e0f3fc391ed3266b54186f1f22c (diff)
refactor: actually use the macro
-rw-r--r--booki.c6
1 files 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 {