diff options
| author | Ben Winston | 2024-05-11 21:04:20 -0400 |
|---|---|---|
| committer | Ben Winston | 2024-05-11 21:04:20 -0400 |
| commit | f6c57a72dcdd3a5ad0f4ac9a2e73245dc00a3abd (patch) | |
| tree | 14cf2246eda3c9593111b8aefe7debd0ff6e33b8 | |
| parent | 9923100cba261e0f3fc391ed3266b54186f1f22c (diff) | |
refactor: actually use the macro
| -rw-r--r-- | booki.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -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 { |
