summaryrefslogtreecommitdiff
path: root/grep.c
diff options
context:
space:
mode:
Diffstat (limited to 'grep.c')
-rw-r--r--grep.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/grep.c b/grep.c
index 10e1a16..344921f 100644
--- a/grep.c
+++ b/grep.c
@@ -42,9 +42,9 @@ struct grep_list {
enum { NORMAL, COUNT, LIST, QUIET } grep_display = NORMAL;
static int grep_filenames = 0;
static int grep_linenumbers = 0;
+static int grep_inverse = 0;
#define SUPPRESS 1 << 2
-#define INVERT 1 << 3
#define WHOLELINE 1 << 4
#define FILENAMES 1 << 5
@@ -59,11 +59,11 @@ static int grep_match(struct grep_list *head, const char *buf)
}
if (regexec(&(c->re), buf, 0, NULL, 0) == 0) {
- return 1;
+ return !grep_inverse;
}
}
- return 0;
+ return grep_inverse;
}
static uintmax_t grep(struct grep_list *head, const char *path, int flags)
@@ -220,7 +220,7 @@ int main(int argc, char *argv[])
break;
case 'v':
- //flags |= INVERT;
+ grep_inverse = 1;
break;
case 'x':