diff --git a/CheckMan b/CheckMan index 5686746..2f84f99 100755 --- a/CheckMan +++ b/CheckMan @@ -16,6 +16,7 @@ while (scalar(@ARGV) > 0) while () { + $count = 0; $line++; if (/^\s*$/) { @@ -50,14 +51,24 @@ while (scalar(@ARGV) > 0) $yield = 1; } } - else + elsif (/\\[^ef]|\\f[^IBP]/) { - if (/\\[^ef]|\\f[^IBP]/) - { - printf "Bad backslash in line $line of $file\n"; - $yield = 1; - } - } + printf "Bad backslash in line $line of $file\n"; + $yield = 1; + } + while (/\\f[BI]/g) + { + $count++; + } + while (/\\fP/g) + { + $count--; + } + if ($count != 0) + { + printf "Mismatching formatting in line $line of $file\n"; + $yield = 1; + } } close(IN); diff --git a/doc/html/pcre2_jit_free_unused_memory.html b/doc/html/pcre2_jit_free_unused_memory.html index 8b59b8e..7f37e58 100644 --- a/doc/html/pcre2_jit_free_unused_memory.html +++ b/doc/html/pcre2_jit_free_unused_memory.html @@ -29,7 +29,7 @@ This function frees unused JIT executable memory. The argument is a general context, for custom memory management, or NULL for standard memory management. JIT memory allocation retains some memory in order to improve future JIT compilation speed. In low memory conditions, -\fBpcre2_jit_free_unused_memory()\fB can be used to cause this memory to be +pcre2_jit_free_unused_memory() can be used to cause this memory to be freed.

diff --git a/doc/html/pcre2api.html b/doc/html/pcre2api.html index ac64af4..36c2e3d 100644 --- a/doc/html/pcre2api.html +++ b/doc/html/pcre2api.html @@ -252,7 +252,7 @@ document for an overview of all the PCRE2 documentation. int pcre2_substitute(const pcre2_code *code, PCRE2_SPTR subject, PCRE2_SIZE length, PCRE2_SIZE startoffset, uint32_t options, pcre2_match_data *match_data, - pcre2_match_context *mcontext, PCRE2_SPTR \fIreplacementzfP, + pcre2_match_context *mcontext, PCRE2_SPTR replacementz, PCRE2_SIZE rlength, PCRE2_UCHAR *outputbuffer, PCRE2_SIZE *outlengthptr);

@@ -3485,7 +3485,7 @@ set in the match context, searching stops when that limit is reached.

You can restrict the effect of a global substitution to a portion of the subject string by setting either or both of startoffset and an offset -limit. Here is a \fPpcre2test\fP example: +limit. Here is a pcre2test example:

   /B/g,replace=!,use_offset_limit
   ABC ABC ABC ABC\=offset=3,offset_limit=12
diff --git a/doc/html/pcre2build.html b/doc/html/pcre2build.html
index 5bd73a9..a206b23 100644
--- a/doc/html/pcre2build.html
+++ b/doc/html/pcre2build.html
@@ -436,7 +436,7 @@ default parameter values by adding, for example,
   --with-pcre2grep-bufsize=51200
   --with-pcre2grep-max-bufsize=2097152
 
-to the configure command. The caller of \fPpcre2grep\fP can override +to the configure command. The caller of pcre2grep can override these values by using --buffer-size and --max-buffer-size on the command line.


PCRE2TEST OPTION FOR LIBREADLINE SUPPORT
diff --git a/doc/html/pcre2grep.html b/doc/html/pcre2grep.html index a285a60..0b2f241 100644 --- a/doc/html/pcre2grep.html +++ b/doc/html/pcre2grep.html @@ -562,7 +562,7 @@ when the PCRE2 library is compiled; if they are not specified, the defaults are very large and so effectively unlimited.

-\fB--max-buffer-size=number +--max-buffer-size=number This limits the expansion of the processing buffer, whose initial size can be set by --buffer-size. The maximum buffer size is silently forced to be no smaller than the starting buffer size. @@ -597,7 +597,7 @@ well as possibly handling a two-character newline sequence. There is a limit to the number of lines that can be matched, imposed by the way that pcre2grep buffers the input file as it scans it. With a sufficiently large processing buffer, this should not be a problem, but the -M option -does not work when input is read line by line (see \fP--line-buffered\fP.) +does not work when input is read line by line (see --line-buffered.)

-N newline-type, --newline=newline-type diff --git a/doc/html/pcre2jit.html b/doc/html/pcre2jit.html index 47b588e..423dfd8 100644 --- a/doc/html/pcre2jit.html +++ b/doc/html/pcre2jit.html @@ -90,7 +90,7 @@ or a negative error code. There is a limit to the size of pattern that JIT supports, imposed by the size of machine stack that it uses. The exact rules are not documented because they may change at any time, in particular, when new optimizations are introduced. -If a pattern is too big, a call to \fBpcre2_jit_compile()\fB returns +If a pattern is too big, a call to pcre2_jit_compile() returns PCRE2_ERROR_NOMEMORY.

@@ -339,12 +339,12 @@ stack through the JIT callback function. You can free a JIT stack at any time, as long as it will not be used by pcre2_match() again. When you assign the stack to a match context, only a pointer is set. There is no reference counting or any other magic. You can free -compiled patterns, contexts, and stacks in any order, anytime. Just \fIdo -not\fP call pcre2_match() with a match context pointing to an already -freed stack, as that will cause SEGFAULT. (Also, do not free a stack currently -used by pcre2_match() in another thread). You can also replace the stack -in a context at any time when it is not in use. You should free the previous -stack before assigning a replacement. +compiled patterns, contexts, and stacks in any order, anytime. +Just do not call pcre2_match() with a match context pointing to an +already freed stack, as that will cause SEGFAULT. (Also, do not free a stack +currently used by pcre2_match() in another thread). You can also replace +the stack in a context at any time when it is not in use. You should free the +previous stack before assigning a replacement.

(5) Should I allocate/free a stack every time before/after calling diff --git a/doc/html/pcre2partial.html b/doc/html/pcre2partial.html index 438c52c..bb73b1d 100644 --- a/doc/html/pcre2partial.html +++ b/doc/html/pcre2partial.html @@ -295,7 +295,7 @@ these characters with '<' if the allusedtext modifier is set: Partial match: 123ab <<< -However, the \fPallusedtext\fP modifier is not available for JIT matching, +However, the allusedtext modifier is not available for JIT matching, because JIT matching does not record the first (or last) consulted characters. For this reason, this information is not available via the API. It is therefore not possible in general to obtain the exact number of characters that must be diff --git a/doc/html/pcre2test.html b/doc/html/pcre2test.html index d178f99..920b265 100644 --- a/doc/html/pcre2test.html +++ b/doc/html/pcre2test.html @@ -261,7 +261,7 @@ standard output, then exit with zero exit code. All other options are ignored. If both -C and -LM are present, whichever is first is recognized.

-\fB-pattern\fB modifier-list +-pattern modifier-list Behave as if each pattern line contains the given modifiers.

diff --git a/doc/pcre2.txt b/doc/pcre2.txt index a5ad12b..71fbc3c 100644 --- a/doc/pcre2.txt +++ b/doc/pcre2.txt @@ -180,8 +180,8 @@ REVISION Last updated: 17 September 2018 Copyright (c) 1997-2018 University of Cambridge. ------------------------------------------------------------------------------ - - + + PCRE2API(3) Library Functions Manual PCRE2API(3) @@ -351,7 +351,7 @@ PCRE2 NATIVE API STRING SUBSTITUTION FUNCTION int pcre2_substitute(const pcre2_code *code, PCRE2_SPTR subject, PCRE2_SIZE length, PCRE2_SIZE startoffset, uint32_t options, pcre2_match_data *match_data, - pcre2_match_context *mcontext, PCRE2_SPTR replacementzfP, + pcre2_match_context *mcontext, PCRE2_SPTR replacementz, PCRE2_SIZE rlength, PCRE2_UCHAR *outputbuffer, PCRE2_SIZE *outlengthptr); @@ -3796,8 +3796,8 @@ REVISION Last updated: 19 March 2020 Copyright (c) 1997-2020 University of Cambridge. ------------------------------------------------------------------------------ - - + + PCRE2BUILD(3) Library Functions Manual PCRE2BUILD(3) @@ -4390,8 +4390,8 @@ REVISION Last updated: 20 March 2020 Copyright (c) 1997-2020 University of Cambridge. ------------------------------------------------------------------------------ - - + + PCRE2CALLOUT(3) Library Functions Manual PCRE2CALLOUT(3) @@ -4820,8 +4820,8 @@ REVISION Last updated: 03 February 2019 Copyright (c) 1997-2019 University of Cambridge. ------------------------------------------------------------------------------ - - + + PCRE2COMPAT(3) Library Functions Manual PCRE2COMPAT(3) @@ -5029,8 +5029,8 @@ REVISION Last updated: 13 July 2019 Copyright (c) 1997-2019 University of Cambridge. ------------------------------------------------------------------------------ - - + + PCRE2JIT(3) Library Functions Manual PCRE2JIT(3) @@ -5334,7 +5334,7 @@ JIT STACK FAQ pcre2_match() again. When you assign the stack to a match context, only a pointer is set. There is no reference counting or any other magic. You can free compiled patterns, contexts, and stacks in any order, any- - time. Just do not call pcre2_match() with a match context pointing to + time. Just do not call pcre2_match() with a match context pointing to an already freed stack, as that will cause SEGFAULT. (Also, do not free a stack currently used by pcre2_match() in another thread). You can also replace the stack in a context at any time when it is not in use. @@ -5454,8 +5454,8 @@ REVISION Last updated: 23 May 2019 Copyright (c) 1997-2019 University of Cambridge. ------------------------------------------------------------------------------ - - + + PCRE2LIMITS(3) Library Functions Manual PCRE2LIMITS(3) @@ -5524,8 +5524,8 @@ REVISION Last updated: 02 February 2019 Copyright (c) 1997-2019 University of Cambridge. ------------------------------------------------------------------------------ - - + + PCRE2MATCHING(3) Library Functions Manual PCRE2MATCHING(3) @@ -5748,8 +5748,8 @@ REVISION Last updated: 23 May 2019 Copyright (c) 1997-2019 University of Cambridge. ------------------------------------------------------------------------------ - - + + PCRE2PARTIAL(3) Library Functions Manual PCRE2PARTIAL(3) @@ -6128,8 +6128,8 @@ REVISION Last updated: 04 September 2019 Copyright (c) 1997-2019 University of Cambridge. ------------------------------------------------------------------------------ - - + + PCRE2PATTERN(3) Library Functions Manual PCRE2PATTERN(3) @@ -9562,8 +9562,8 @@ REVISION Last updated: 24 February 2020 Copyright (c) 1997-2020 University of Cambridge. ------------------------------------------------------------------------------ - - + + PCRE2PERFORM(3) Library Functions Manual PCRE2PERFORM(3) @@ -9797,8 +9797,8 @@ REVISION Last updated: 03 February 2019 Copyright (c) 1997-2019 University of Cambridge. ------------------------------------------------------------------------------ - - + + PCRE2POSIX(3) Library Functions Manual PCRE2POSIX(3) @@ -10127,8 +10127,8 @@ REVISION Last updated: 30 January 2019 Copyright (c) 1997-2019 University of Cambridge. ------------------------------------------------------------------------------ - - + + PCRE2SAMPLE(3) Library Functions Manual PCRE2SAMPLE(3) @@ -10406,8 +10406,8 @@ REVISION Last updated: 27 June 2018 Copyright (c) 1997-2018 University of Cambridge. ------------------------------------------------------------------------------ - - + + PCRE2SYNTAX(3) Library Functions Manual PCRE2SYNTAX(3) @@ -10922,8 +10922,8 @@ REVISION Last updated: 28 December 2019 Copyright (c) 1997-2019 University of Cambridge. ------------------------------------------------------------------------------ - - + + PCRE2UNICODE(3) Library Functions Manual PCRE2UNICODE(3) @@ -11357,5 +11357,5 @@ REVISION Last updated: 23 February 2020 Copyright (c) 1997-2020 University of Cambridge. ------------------------------------------------------------------------------ - - + + diff --git a/doc/pcre2_jit_free_unused_memory.3 b/doc/pcre2_jit_free_unused_memory.3 index bf050c8..183bba0 100644 --- a/doc/pcre2_jit_free_unused_memory.3 +++ b/doc/pcre2_jit_free_unused_memory.3 @@ -17,7 +17,7 @@ This function frees unused JIT executable memory. The argument is a general context, for custom memory management, or NULL for standard memory management. JIT memory allocation retains some memory in order to improve future JIT compilation speed. In low memory conditions, -\fBpcre2_jit_free_unused_memory()\fB can be used to cause this memory to be +\fBpcre2_jit_free_unused_memory()\fP can be used to cause this memory to be freed. .P There is a complete description of the PCRE2 native API in the diff --git a/doc/pcre2api.3 b/doc/pcre2api.3 index b992a53..8c581a0 100644 --- a/doc/pcre2api.3 +++ b/doc/pcre2api.3 @@ -187,7 +187,7 @@ document for an overview of all the PCRE2 documentation. .B int pcre2_substitute(const pcre2_code *\fIcode\fP, PCRE2_SPTR \fIsubject\fP, .B " PCRE2_SIZE \fIlength\fP, PCRE2_SIZE \fIstartoffset\fP," .B " uint32_t \fIoptions\fP, pcre2_match_data *\fImatch_data\fP," -.B " pcre2_match_context *\fImcontext\fP, PCRE2_SPTR \fIreplacementzfP," +.B " pcre2_match_context *\fImcontext\fP, PCRE2_SPTR \fIreplacementz\fP," .B " PCRE2_SIZE \fIrlength\fP, PCRE2_UCHAR *\fIoutputbuffer\fP," .B " PCRE2_SIZE *\fIoutlengthptr\fP);" .fi @@ -3495,7 +3495,7 @@ set in the match context, searching stops when that limit is reached. .P You can restrict the effect of a global substitution to a portion of the subject string by setting either or both of \fIstartoffset\fP and an offset -limit. Here is a \fPpcre2test\fP example: +limit. Here is a \fBpcre2test\fP example: .sp /B/g,replace=!,use_offset_limit ABC ABC ABC ABC\e=offset=3,offset_limit=12 diff --git a/doc/pcre2build.3 b/doc/pcre2build.3 index 0c469f0..edea222 100644 --- a/doc/pcre2build.3 +++ b/doc/pcre2build.3 @@ -439,7 +439,7 @@ default parameter values by adding, for example, --with-pcre2grep-bufsize=51200 --with-pcre2grep-max-bufsize=2097152 .sp -to the \fBconfigure\fP command. The caller of \fPpcre2grep\fP can override +to the \fBconfigure\fP command. The caller of \fBpcre2grep\fP can override these values by using --buffer-size and --max-buffer-size on the command line. . . diff --git a/doc/pcre2grep.1 b/doc/pcre2grep.1 index d34881f..137117a 100644 --- a/doc/pcre2grep.1 +++ b/doc/pcre2grep.1 @@ -488,7 +488,7 @@ There are no short forms for these options. The default limits can be set when the PCRE2 library is compiled; if they are not specified, the defaults are very large and so effectively unlimited. .TP -\fB--max-buffer-size=\fInumber\fP +\fB--max-buffer-size\fP=\fInumber\fP This limits the expansion of the processing buffer, whose initial size can be set by \fB--buffer-size\fP. The maximum buffer size is silently forced to be no smaller than the starting buffer size. @@ -520,7 +520,7 @@ well as possibly handling a two-character newline sequence. There is a limit to the number of lines that can be matched, imposed by the way that \fBpcre2grep\fP buffers the input file as it scans it. With a sufficiently large processing buffer, this should not be a problem, but the \fB-M\fP option -does not work when input is read line by line (see \fP--line-buffered\fP.) +does not work when input is read line by line (see \fB--line-buffered\fP.) .TP \fB-N\fP \fInewline-type\fP, \fB--newline\fP=\fInewline-type\fP Six different conventions for indicating the ends of lines in scanned files are diff --git a/doc/pcre2jit.3 b/doc/pcre2jit.3 index f4be3fb..fab8366 100644 --- a/doc/pcre2jit.3 +++ b/doc/pcre2jit.3 @@ -64,7 +64,7 @@ or a negative error code. There is a limit to the size of pattern that JIT supports, imposed by the size of machine stack that it uses. The exact rules are not documented because they may change at any time, in particular, when new optimizations are introduced. -If a pattern is too big, a call to \fBpcre2_jit_compile()\fB returns +If a pattern is too big, a call to \fBpcre2_jit_compile()\fP returns PCRE2_ERROR_NOMEMORY. .P PCRE2_JIT_COMPLETE requests the JIT compiler to generate code for complete @@ -315,12 +315,12 @@ stack through the JIT callback function. You can free a JIT stack at any time, as long as it will not be used by \fBpcre2_match()\fP again. When you assign the stack to a match context, only a pointer is set. There is no reference counting or any other magic. You can free -compiled patterns, contexts, and stacks in any order, anytime. Just \fIdo -not\fP call \fBpcre2_match()\fP with a match context pointing to an already -freed stack, as that will cause SEGFAULT. (Also, do not free a stack currently -used by \fBpcre2_match()\fP in another thread). You can also replace the stack -in a context at any time when it is not in use. You should free the previous -stack before assigning a replacement. +compiled patterns, contexts, and stacks in any order, anytime. +Just \fIdo not\fP call \fBpcre2_match()\fP with a match context pointing to an +already freed stack, as that will cause SEGFAULT. (Also, do not free a stack +currently used by \fBpcre2_match()\fP in another thread). You can also replace +the stack in a context at any time when it is not in use. You should free the +previous stack before assigning a replacement. .P (5) Should I allocate/free a stack every time before/after calling \fBpcre2_match()\fP? diff --git a/doc/pcre2partial.3 b/doc/pcre2partial.3 index 3ff939f..892906a 100644 --- a/doc/pcre2partial.3 +++ b/doc/pcre2partial.3 @@ -261,7 +261,7 @@ these characters with '<' if the \fBallusedtext\fP modifier is set: Partial match: 123ab <<< .sp -However, the \fPallusedtext\fP modifier is not available for JIT matching, +However, the \fBallusedtext\fP modifier is not available for JIT matching, because JIT matching does not record the first (or last) consulted characters. For this reason, this information is not available via the API. It is therefore not possible in general to obtain the exact number of characters that must be diff --git a/doc/pcre2test.1 b/doc/pcre2test.1 index bae4c22..ec17763 100644 --- a/doc/pcre2test.1 +++ b/doc/pcre2test.1 @@ -218,7 +218,7 @@ List modifiers: write a list of available pattern and subject modifiers to the standard output, then exit with zero exit code. All other options are ignored. If both -C and -LM are present, whichever is first is recognized. .TP 10 -\fB-pattern\fB \fImodifier-list\fP +\fB-pattern\fP \fImodifier-list\fP Behave as if each pattern line contains the given modifiers. .TP 10 \fB-q\fP