diff --git a/ChangeLog b/ChangeLog index 58dd453..53d8afe 100644 --- a/ChangeLog +++ b/ChangeLog @@ -92,6 +92,9 @@ only when PCRE2_NO_START_OPTIMIZE was *not* set: (?=.*[A-Z])(?=.{8,16})(?!.*[\s]) matches after the start in lines that start with spaces. Starting .* in an assertion is no longer taken as an 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 diff --git a/src/pcre2test.c b/src/pcre2test.c index 039a4f0..30fd190 100644 --- a/src/pcre2test.c +++ b/src/pcre2test.c @@ -6065,6 +6065,7 @@ if ((pat_patctl.control & CTL_POSIX) != 0) if (dat_datctl.get_numbers[0] >= 0 || dat_datctl.get_names[0] != 0) prmsg(&msg, "get"); 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) { @@ -6087,9 +6088,8 @@ if ((pat_patctl.control & CTL_POSIX) != 0) if ((dat_datctl.options & PCRE2_NOTBOL) != 0) eflags |= REG_NOTBOL; if ((dat_datctl.options & PCRE2_NOTEOL) != 0) eflags |= REG_NOTEOL; if ((dat_datctl.options & PCRE2_NOTEMPTY) != 0) eflags |= REG_NOTEMPTY; - - rc = regexec(&preg, (const char *)pp + dat_datctl.offset, - dat_datctl.oveccount, pmatch, eflags); + + rc = regexec(&preg, (const char *)pp, dat_datctl.oveccount, pmatch, eflags); if (rc != 0) { (void)regerror(rc, &preg, (char *)pbuffer8, pbuffer8_size); diff --git a/testdata/testinput18 b/testdata/testinput18 index e31b96e..ea47a4d 100644 --- a/testdata/testinput18 +++ b/testdata/testinput18 @@ -103,4 +103,7 @@ /\[A]{1000000}**/expand,regerror_buffsize=32 +//posix_nosub + \=offset=70000 + # End of testdata/testinput18 diff --git a/testdata/testoutput18 b/testdata/testoutput18 index 3df298c..e2eb009 100644 --- a/testdata/testoutput18 +++ b/testdata/testoutput18 @@ -157,4 +157,9 @@ Failed: POSIX code 4: ? * + invalid at offset 100000 /\[A]{1000000}**/expand,regerror_buffsize=32 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