diff options
| -rw-r--r-- | booki.c | 12 |
1 files changed, 7 insertions, 5 deletions
@@ -493,7 +493,7 @@ char** search(int argc, char* argv[], char* booki_file) { char* field; int i; - bool print = true; + bool match = true; for (i = 0; i < search_opts.count; i++) { field = search_opts.opts[i]; @@ -525,11 +525,13 @@ char** search(int argc, char* argv[], char* booki_file) { break; } } - print = i == search_opts.count; + match = i == search_opts.count; - if (print) { - print_book(*book, search_opts.show); - write_book(*book, output); + if (match) { + if (search_opts.edit) + write_book(*book, output); + else + print_book(*book, search_opts.show); book_count++; } } |
