Skip to content

Commit

Permalink
Doc update; add tests for recent patch; remove unnecessary line in pc…
Browse files Browse the repository at this point in the history
…re2grep (found by coverity)
  • Loading branch information
PhilipHazel committed Nov 21, 2023
1 parent 04f6668 commit a0c5393
Show file tree
Hide file tree
Showing 9 changed files with 305 additions and 258 deletions.
13 changes: 12 additions & 1 deletion doc/html/pcre2grep.html
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,11 @@ <h1>pcre2grep man page</h1>
exclusive with <b>--output</b>, <b>--line-offsets</b>, and <b>--only-matching</b>.
</P>
<P>
<b>--group-separator</b>=<i>text</i>
Output this text string instead of two hyphens between groups of lines when
<b>-A</b>, <b>-B</b>, or <b>-C</b> is in use. See also <b>--no-group-separator</b>.
</P>
<P>
<b>-H</b>, <b>--with-filename</b>
Force the inclusion of the file name at the start of output lines when
searching a single file. The file name is not normally shown in this case.
Expand Down Expand Up @@ -678,6 +683,12 @@ <h1>pcre2grep man page</h1>
number. This option is forced if <b>--line-offsets</b> is used.
</P>
<P>
<b>--no-group-separator</b>
Do not output a separator between groups of lines when <b>-A</b>, <b>-B</b>, or
<b>-C</b> is in use. The default is to output a line containing two hyphens. See
also <b>--group-separator</b>.
</P>
<P>
<b>--no-jit</b>
If the PCRE2 library is built with support for just-in-time compiling (which
speeds up matching), <b>pcre2grep</b> automatically makes use of this, unless it
Expand Down Expand Up @@ -1096,7 +1107,7 @@ <h1>pcre2grep man page</h1>
</P>
<br><a name="SEC16" href="#TOC1">REVISION</a><br>
<P>
Last updated: 08 February 2023
Last updated: 20 November 2023
<br>
Copyright &copy; 1997-2023 University of Cambridge.
<br>
Expand Down
10 changes: 8 additions & 2 deletions doc/html/pcre2posix.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ <h1>pcre2posix man page</h1>
</P>
<P>
<b>IMPORTANT NOTE</b>: The functions described here are NOT thread-safe, and
should not be used in multi-threaded applications. Use the native API instead.
should not be used in multi-threaded applications. They are also limited to
processing subjects that are not bigger than 2GB. Use the native API instead.
</P>
<P>
These functions are wrapper functions that ultimately call the PCRE2 native
Expand Down Expand Up @@ -99,7 +100,7 @@ <h1>pcre2posix man page</h1>
<P>
Note that these functions are just POSIX-style wrappers for PCRE2's native API.
They do not give POSIX regular expression behaviour, and they are not
thread-safe.
thread-safe or even POSIX compatible.
</P>
<P>
Those POSIX option bits that can reasonably be mapped to PCRE2 native options
Expand Down Expand Up @@ -332,6 +333,11 @@ <h1>pcre2posix man page</h1>
array have both structure members set to -1.
</P>
<P>
<i>regmatch_t</i> as well as the <i>regoff_t</i> typedef it uses are defined in
<b>pcre2posix.h</b> and are not warranted to have the same size or layout as other
similarly named types from other libraries that provide POSIX-style matching.
</P>
<P>
A successful match yields a zero return; various error codes are defined in the
header file, of which REG_NOMATCH is the "expected" failure code.
</P>
Expand Down
246 changes: 126 additions & 120 deletions doc/pcre2.txt

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion doc/pcre2demo.3
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.TH PCRE2DEMO 3 "14 November 2023" "PCRE2 10.43-DEV"
.TH PCRE2DEMO 3 "21 November 2023" "PCRE2 10.43-DEV"
.\"AUTOMATICALLY GENERATED BY PrepareRelease - do not EDIT!
.SH NAME
// - A demonstration C program for PCRE2 - //
Expand Down
2 changes: 1 addition & 1 deletion doc/pcre2grep.1
Original file line number Diff line number Diff line change
Expand Up @@ -594,7 +594,7 @@ being output, it precedes the line number. When the \fB-M\fP option causes a
pattern to match more than one line, only the first is preceded by its line
number. This option is forced if \fB--line-offsets\fP is used.
.TP
\fB--no-group-separator\fP\fP
\fB--no-group-separator\fP
Do not output a separator between groups of lines when \fB-A\fP, \fB-B\fP, or
\fB-C\fP is in use. The default is to output a line containing two hyphens. See
also \fB--group-separator\fP.
Expand Down
274 changes: 142 additions & 132 deletions doc/pcre2grep.txt

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/pcre2grep.c
Original file line number Diff line number Diff line change
Expand Up @@ -2878,7 +2878,7 @@ while (ptr < endptr)

/* Prepare to repeat to find the next match in the line. */

match = FALSE;
//match = FALSE;
if (line_buffered) fflush(stdout);
rc = 0; /* Had some success */

Expand Down
2 changes: 2 additions & 0 deletions testdata/testinput2
Original file line number Diff line number Diff line change
Expand Up @@ -6053,4 +6053,6 @@ a)"xI

/A +/extended

/(*ACCEPT)+/B,auto_callout

# End of testinput2
12 changes: 12 additions & 0 deletions testdata/testoutput2
Original file line number Diff line number Diff line change
Expand Up @@ -17934,6 +17934,18 @@ No match

/A +/extended

/(*ACCEPT)+/B,auto_callout
------------------------------------------------------------------
Bra
Callout 255 0 10
SBra
*ACCEPT
KetRmax
Callout 255 10 0
Ket
End
------------------------------------------------------------------

# End of testinput2
Error -70: PCRE2_ERROR_BADDATA (unknown error number)
Error -62: bad serialized data
Expand Down

0 comments on commit a0c5393

Please sign in to comment.