diff options
Diffstat (limited to 'booki.c')
| -rw-r--r-- | booki.c | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -112,6 +112,10 @@ struct Book parse_book(char* current_pos) { struct es author = parse_string(current_pos, &new_pos); book.author = author; current_pos = new_pos; + } else if (strncmp(attr, "language", 8) == 0) { + struct es language = parse_string(current_pos, &new_pos); + book.language = language; + current_pos = new_pos; } // go to (and then past) the newline @@ -306,6 +310,9 @@ char** search(int argc, char* argv[]) { } else if (strcmp(field, "author") == 0) { if (!regex_match(search_opts.args[i], book.author)) break; + } else if (strcmp(field, "language") == 0) { + if (!regex_match(search_opts.args[i], book.language)) + break; } else { printf("unsupported field: %s\n", field); break; |
