diff options
Diffstat (limited to 'posix/bug-regex11.c')
-rw-r--r-- | posix/bug-regex11.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/posix/bug-regex11.c b/posix/bug-regex11.c index da1fc35..5c8179d 100644 --- a/posix/bug-regex11.c +++ b/posix/bug-regex11.c @@ -24,19 +24,20 @@ #include <stdio.h> #include <stdlib.h> +/* Tests supposed to match. */ struct { const char *pattern; const char *string; - int nmatch; + int flags, nmatch; regmatch_t rm[4]; } tests[] = { /* Test for newline handling in regex. */ - { "[^~]*~", "\nx~y", 2, { { 0, 3 }, { -1, -1 } } }, + { "[^~]*~", "\nx~y", 0, 2, { { 0, 3 }, { -1, -1 } } }, /* Other tests. */ - { ".*|\\([KIO]\\)\\([^|]*\\).*|?[KIO]", "10~.~|P|K0|I10|O16|?KSb", 3, + { ".*|\\([KIO]\\)\\([^|]*\\).*|?[KIO]", "10~.~|P|K0|I10|O16|?KSb", 0, 3, { { 0, 21 }, { 15, 16 }, { 16, 18 } } }, - { ".*|\\([KIO]\\)\\([^|]*\\).*|?\\1", "10~.~|P|K0|I10|O16|?KSb", 3, + { ".*|\\([KIO]\\)\\([^|]*\\).*|?\\1", "10~.~|P|K0|I10|O16|?KSb", 0, 3, { { 0, 21 }, { 8, 9 }, { 9, 10 } } } }; @@ -45,13 +46,14 @@ main (void) { regex_t re; regmatch_t rm[4]; - int n, i, ret = 0; + size_t i; + int n, ret = 0; mtrace (); for (i = 0; i < sizeof (tests) / sizeof (tests[0]); ++i) { - n = regcomp (&re, tests[i].pattern, 0); + n = regcomp (&re, tests[i].pattern, tests[i].flags); if (n != 0) { char buf[500]; @@ -84,5 +86,5 @@ main (void) regfree (&re); } - return 0; + return ret; } |