[Pcre-svn] [576] code/trunk: The "offset" modifier in pcre2t…

Top Page
Delete this message
Author: Subversion repository
Date:  
To: pcre-svn
Subject: [Pcre-svn] [576] code/trunk: The "offset" modifier in pcre2test was not being ignored (as documented) for
Revision: 576
          http://www.exim.org/viewvc/pcre2?view=rev&revision=576
Author:   ph10
Date:     2016-10-23 17:18:15 +0100 (Sun, 23 Oct 2016)
Log Message:
-----------
The "offset" modifier in pcre2test was not being ignored (as documented) for 
POSIX.


Modified Paths:
--------------
    code/trunk/ChangeLog
    code/trunk/src/pcre2test.c
    code/trunk/testdata/testinput18
    code/trunk/testdata/testoutput18


Modified: code/trunk/ChangeLog
===================================================================
--- code/trunk/ChangeLog    2016-10-23 15:43:42 UTC (rev 575)
+++ code/trunk/ChangeLog    2016-10-23 16:18:15 UTC (rev 576)
@@ -92,6 +92,9 @@
         (?=.*[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

Modified: code/trunk/src/pcre2test.c
===================================================================
--- code/trunk/src/pcre2test.c    2016-10-23 15:43:42 UTC (rev 575)
+++ code/trunk/src/pcre2test.c    2016-10-23 16:18:15 UTC (rev 576)
@@ -6065,6 +6065,7 @@
   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 ((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);


Modified: code/trunk/testdata/testinput18
===================================================================
--- code/trunk/testdata/testinput18    2016-10-23 15:43:42 UTC (rev 575)
+++ code/trunk/testdata/testinput18    2016-10-23 16:18:15 UTC (rev 576)
@@ -103,4 +103,7 @@


/\[A]{1000000}**/expand,regerror_buffsize=32

+//posix_nosub
+    \=offset=70000
+
 # End of testdata/testinput18


Modified: code/trunk/testdata/testoutput18
===================================================================
--- code/trunk/testdata/testoutput18    2016-10-23 15:43:42 UTC (rev 575)
+++ code/trunk/testdata/testoutput18    2016-10-23 16:18:15 UTC (rev 576)
@@ -157,4 +157,9 @@
 /\[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