diff options
| author | Jakob Kaivo <jkk@ung.org> | 2022-04-20 21:33:51 -0400 |
|---|---|---|
| committer | Jakob Kaivo <jkk@ung.org> | 2022-04-20 21:33:51 -0400 |
| commit | 85647411a613be53eceeb4807927da06426369b5 (patch) | |
| tree | a29c09e3a9c5187e10b0b9081f423af9b1434831 | |
| parent | 00dd5525b795674a0e1337159740815615f89835 (diff) | |
fix -E and BRE
| -rw-r--r-- | grep.c | 19 |
1 files changed, 1 insertions, 18 deletions
@@ -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; } |
