diff options
Diffstat (limited to 'grep.c')
| -rw-r--r-- | grep.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -50,8 +50,11 @@ static int grep_match(struct grep_list *head, const char *buf) { for (struct grep_list *c = head; c != NULL; c = c->next) { if (c->string) { - if (strstr(buf, c->string)) { - return 1; + if (grep_exact && strcmp(buf, c->string) == 0) { + return !grep_inverse; + } + if (!grep_exact && strstr(buf, c->string)) { + return !grep_inverse; } continue; } |
