The "offset" modifier in pcre2test was not being ignored (as documented) for

POSIX.
This commit is contained in:
Philip.Hazel 2016-10-23 16:18:15 +00:00
parent cfa7e70148
commit d117300a1d
4 changed files with 14 additions and 3 deletions

View File

@ -93,6 +93,9 @@ only when PCRE2_NO_START_OPTIMIZE was *not* set:
start with spaces. Starting .* in an assertion is no longer taken as an start with spaces. Starting .* in an assertion is no longer taken as an
indication of matching at the start (or after a newline). indication of matching at the start (or after a newline).
16. The "offset" modifier in pcre2test was not being ignored (as documented)
when the POSIX API was in use.
Version 10.22 29-July-2016 Version 10.22 29-July-2016
-------------------------- --------------------------

View File

@ -6065,6 +6065,7 @@ if ((pat_patctl.control & CTL_POSIX) != 0)
if (dat_datctl.get_numbers[0] >= 0 || dat_datctl.get_names[0] != 0) if (dat_datctl.get_numbers[0] >= 0 || dat_datctl.get_names[0] != 0)
prmsg(&msg, "get"); prmsg(&msg, "get");
if (dat_datctl.jitstack != 0) prmsg(&msg, "jitstack"); if (dat_datctl.jitstack != 0) prmsg(&msg, "jitstack");
if (dat_datctl.offset != 0) prmsg(&msg, "offset");
if ((dat_datctl.options & ~POSIX_SUPPORTED_MATCH_OPTIONS) != 0) if ((dat_datctl.options & ~POSIX_SUPPORTED_MATCH_OPTIONS) != 0)
{ {
@ -6088,8 +6089,7 @@ if ((pat_patctl.control & CTL_POSIX) != 0)
if ((dat_datctl.options & PCRE2_NOTEOL) != 0) eflags |= REG_NOTEOL; if ((dat_datctl.options & PCRE2_NOTEOL) != 0) eflags |= REG_NOTEOL;
if ((dat_datctl.options & PCRE2_NOTEMPTY) != 0) eflags |= REG_NOTEMPTY; if ((dat_datctl.options & PCRE2_NOTEMPTY) != 0) eflags |= REG_NOTEMPTY;
rc = regexec(&preg, (const char *)pp + dat_datctl.offset, rc = regexec(&preg, (const char *)pp, dat_datctl.oveccount, pmatch, eflags);
dat_datctl.oveccount, pmatch, eflags);
if (rc != 0) if (rc != 0)
{ {
(void)regerror(rc, &preg, (char *)pbuffer8, pbuffer8_size); (void)regerror(rc, &preg, (char *)pbuffer8, pbuffer8_size);

View File

@ -103,4 +103,7 @@
/\[A]{1000000}**/expand,regerror_buffsize=32 /\[A]{1000000}**/expand,regerror_buffsize=32
//posix_nosub
\=offset=70000
# End of testdata/testinput18 # End of testdata/testinput18

View File

@ -157,4 +157,9 @@ Failed: POSIX code 4: ? * + invalid at offset 100000
/\[A]{1000000}**/expand,regerror_buffsize=32 /\[A]{1000000}**/expand,regerror_buffsize=32
Failed: POSIX code 4: ? * + invalid at offset 1000001 Failed: POSIX code 4: ? * + invalid at offset 1000001
//posix_nosub
\=offset=70000
** Ignored with POSIX interface: offset
Matched with REG_NOSUB
# End of testdata/testinput18 # End of testdata/testinput18