From 85647411a613be53eceeb4807927da06426369b5 Mon Sep 17 00:00:00 2001 From: Jakob Kaivo Date: Wed, 20 Apr 2022 21:33:51 -0400 Subject: fix -E and BRE --- grep.c | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) (limited to 'grep.c') diff --git a/grep.c b/grep.c index 070502b..951e90e 100644 --- a/grep.c +++ b/grep.c @@ -60,12 +60,9 @@ static int grep_match(struct grep_list *head, const char *buf) continue; } - printf("%s => ", buf); - int e; - if ((e = regexec(&(c->re), buf, 0, NULL, REG_NOSUB)) == 0) { + if (regexec(&(c->re), buf, 0, NULL, 0) == 0) { return 1; } - printf("%d\n", e); } return 0; @@ -245,20 +242,6 @@ int main(int argc, char *argv[]) found += grep(head, argv[optind++], flags); } while (optind < argc); - printf("REG_BADBR=%d\n", REG_BADBR); - printf("REG_BADPAT=%d\n", REG_BADPAT); - printf("REG_BADRPT=%d\n", REG_BADRPT); - printf("REG_EBRACE=%d\n", REG_EBRACE); - printf("REG_EBRACK=%d\n", REG_EBRACK); - printf("REG_ECOLLATE=%d\n", REG_ECOLLATE); - printf("REG_ECTYPE=%d\n", REG_ECTYPE); - printf("REG_EESCAPE=%d\n", REG_EESCAPE); - printf("REG_EPAREN=%d\n", REG_EPAREN); - printf("REG_ERANGE=%d\n", REG_ERANGE); - printf("REG_ESPACE=%d\n", REG_ESPACE); - printf("REG_ESUBREG=%d\n", REG_ESUBREG); - printf("REG_NOMATCH=%d\n", REG_NOMATCH); - if (found) { return 0; } -- cgit v1.2.1