Commit Graph

265 Commits

Author SHA1 Message Date
Philip Hazel cc5e121c8e Added some special heap tests 2022-07-28 17:58:19 +01:00
Philip Hazel d90fb23878 Refactor match_data() to always use the heap instead of having an initial frames vector on the stack; some consequential adjustmentsneeded. 2022-07-27 17:44:55 +01:00
Philip Hazel 4804b00e8f Add an #ifdef to avoid the need even to link with pcre2_jit_compile.o when JIT is not supported 2022-06-30 17:37:51 +01:00
Philip Hazel 5271b533c4 Fix compiler warning in pcre2test 2022-06-08 17:05:24 +01:00
Philip Hazel ff5402a378 Add some casts and other tidies to pcre2test formatting of size_t values 2022-04-23 17:34:35 +01:00
Philip Hazel 3103b8f20a Final file tidies for 10.40 2022-04-15 16:57:57 +01:00
Carlo Marcelo Arenas Belón 4279abbd7d
pcre2test: allow using readline headers for libedit (#99)
At least in OpenBSD, there is a libedit library in base, but without
public headers.  Public headers for readline are available but since
15db5d36 (pcre2test: avoid using readline headers with libedit,
2022-04-07) won't be picked up automatically.

Allow pointing cmake to those headers by doing (for example):

  $ cmake -DEDITLINE_INCLUDE_DIR=/usr/include/readline

Or using custom CPPFLAGS with configure (for example):

  $ CPPFLAGS=-I/usr/include/readline ./configure --enable-pcre2test-libedit

Since the headers from readline.h would be otherwise incomplete, detect
that case and pull the extra headers that are required automagically and
while at it, cleanup the NCURSES dependency that was unnecessarily copied
from readline.
2022-04-14 16:51:51 +01:00
Carlo Marcelo Arenas Belón 9c8abddc52
pcre2test: really allow using libedit when enabled (#96)
* pcre2test: use the right header for libedit in FreeBSD with autoconf

When `./configure --enable-pcre2test-libedit` is used in FreeBSD,
the resulting test will succeed but won't set the necessary flag
to distinguish between libedit and readline header files, therefore
using readline's at built time (if installed)

Consolidate all header tests into one and use instead the corresponding
autogenerated defines to check for each possibility.

* pcre2test: really allow libedit with cmake

Using cmake to configure and enable linking pcre2test with libedit,
could result in a broken build, because the header used was instead
pointing to readline.

In cases were the build will succeed (because both libraries were
available), it would likely show warnings, because several history
functions were being used without declarations, since readline
requires including "history.h" for those.

Additionally, since PCRE2_SUPPORT_READLINE is ON by default (unlike
configure), turning PCRE2_SUPPORT_LIBEDIT=ON, would require setting
that other option to OFF explicitly (even if readline wasn't available)
or the setup would abort.

Lastly, in systems with no default sysroot (ex: macOS), the use of
absolute paths for searching for libedit's readline.h could fail so
use instead relative PATH_SUFFIXES.

* pcre2test: avoid using readline headers with libedit

When asked to enable libedit in a system that ALSO has readline,
the headers of the former would be found and used by the earlier.

While that would mostly work, some functions will be missing
definitions (which is forbidden in C99), so instead abort the
configuration and let the user provide for them.
2022-04-08 17:07:30 +01:00
Philip Hazel bf35c0518c Add -LP and -LS (list properties, list scripts) features to pcre2test. 2022-01-12 15:01:14 +00:00
Philip Hazel 06d3a66065 Fix bug in modifier listing 2022-01-11 09:21:27 +00:00
Philip Hazel 1c41a5b815 Fix minor issues raised by Clang sanitize 2021-12-14 15:52:24 +00:00
Philip Hazel 0246c6bf64 Add support for Bidi_Control and Bidi_Class properties 2021-12-08 15:34:27 +00:00
Philip Hazel 2a294ddadb Add check for NULL subject to POSIX regexec(). 2021-11-28 16:38:36 +00:00
Philip Hazel cb854a912e Add options for NULL pointers to pcre2test. 2021-11-28 16:22:24 +00:00
Carlo Marcelo Arenas Belón acc520924c
test: avoid failing RunTest if pcre2test -S is not supported (#37)
* test: avoid failing RunTest if pcre2test -S is not supported

If `pcre2test -S` is not supported then then avoid checking for it
in a test.

There is already a conditional check for it to be used when it is
needed and it is available, so adjust that as well.

* pcre2test: update list of platform support for -S

Minix 3 has a BSD userspace and now works fine, but Haiku still
doesn't support stack limits, so update accordingly.
2021-11-09 17:23:02 +00:00
Carlo Marcelo Arenas Belón d46f1863be
improve on 'auto' mode for DISABLE_PERCENT_ZT (#28)
Visual Studio 2013 includes support for %zu and %td, so let newer
versions of it avoid the fallback, and while at it, make sure that
the first check is for DISABLE_PERCENT_ZT so it will be always
honoured if chosen.

prtdiff_t is signed, so use a signed type instead, and make sure
that an appropiate width is chosen if pointers are 64bit wide.

Remove the need for the size_t cast and instead change the size
of the equivalent format identifier to avoid truncations.
2021-10-29 14:29:47 +01:00
Philip Hazel 21c26698b3 Lock out \K in lookaround assertions by default, but provide an option to
re-enable the old behaviour, just in case.
2021-08-30 16:57:44 +01:00
Philip.Hazel 000bbf2ea7 File tidies for 10.36-RC1 2020-11-06 17:27:35 +00:00
Philip.Hazel a2f0fd01c7 Update pcre2test to check delimiters after #perltest and fix some in test 1. 2020-09-14 15:39:39 +00:00
Philip.Hazel ce558bbff1 Second attempt at getting rid of gcc 10 warning. 2020-04-24 15:36:53 +00:00
Philip.Hazel ca55d0be6b Avoid using [-1] as a suffix in pcre2test as it can provoke a compiler warning. 2020-04-23 15:41:23 +00:00
Philip.Hazel f988433788 Fix resource leak in pcre2test introduced by recent patch. 2020-03-24 17:25:58 +00:00
Philip.Hazel 8057c3c8b9 Renamed dftables as pcre2_dftables and enable it to write the tables in binary.
Update documentation about character tables.
2020-03-20 18:09:59 +00:00
Philip.Hazel e8d70e2459 Implement PCRE2_SUBSTITUTE_REPLACEMENT_ONLY. 2020-01-22 17:50:12 +00:00
Philip.Hazel d170829b26 Implement PCRE2_SUBSTITUTE_MATCHED. 2019-12-27 13:35:17 +00:00
Philip.Hazel f3fd8b18cb Implement PCRE2_SUBSTITUTE_LITERAL. 2019-12-26 14:53:24 +00:00
Philip.Hazel add4db4c87 Final file tidies for 10.34 2019-11-21 16:31:08 +00:00
Philip.Hazel 26fc863155 Update comment about %lu warnings. 2019-11-17 17:38:53 +00:00
Philip.Hazel c0ed5a3ab3 Minor upgrade to pcre2test and comment in ucptest. 2019-07-30 17:59:42 +00:00
Philip.Hazel bca9888a2c Implemented pcre2_get_match_data_size(). 2019-07-16 15:50:09 +00:00
Philip.Hazel a5c601091e Give error for zero timing argument to pcre2test. 2019-07-03 17:15:37 +00:00
Philip.Hazel 434e3f7468 Make pcre2test show actual pre-match consulted characters for a partial match,
not the length of the longest lookbehind. Control this by "allusedtext".
2019-06-26 08:23:47 +00:00
Philip.Hazel 1f6b9097f4 Minor improvement to minimum length calculation. 2019-06-13 16:00:11 +00:00
Philip.Hazel 16c046ce50 Implement support for invalid UTF in the pcre2_match() interpreter. 2019-05-24 17:15:48 +00:00
Philip.Hazel 4acee004ec Casts and rewrites to avoid clang sanitize warnings. 2019-04-16 14:49:07 +00:00
Philip.Hazel 95c9d011e3 Change a number of expressions like 1<<10 to 1u<<10. 2019-04-12 14:40:27 +00:00
Philip.Hazel e85de98d0a Fix crash in pcre2_substitute() with NULL match context. 2019-03-11 17:29:08 +00:00
Philip.Hazel 8c8deae8eb Implement PCRE2_EXTRA_ALT_BSUX to support ECMAscript 6's \u{hhh..} syntax. 2019-02-12 17:50:19 +00:00
Philip.Hazel d7b10a57d1 Allow non-ASCII in group names when UTF is set; revise group naming terminology
in documentation to use "capture group", as Perl does.
2019-02-06 18:11:36 +00:00
Philip.Hazel 149af0e21b Implement --disable-percent-zt to avoid %zu and %td even if the environment
claims to be C99 or greater.
2018-11-15 18:09:02 +00:00
Philip.Hazel 9bc81d5229 Upgrade the as yet unreleased substitute callout facility. 2018-11-12 16:02:01 +00:00
Philip.Hazel 900f457222 Update VMS-specific code in pcre2test, on the advice of a VMS user. 2018-11-09 18:10:25 +00:00
Philip.Hazel 87a9887e6e Add "kibibytes" to the output of pcre2test -C to show the units of the heap
limit.
2018-10-22 16:56:11 +00:00
Philip.Hazel f90ce1a333 Implement PCRE2_COPY_MATCHED_SUBJECT. 2018-10-17 08:33:38 +00:00
Philip.Hazel 69254c77f1 Implement PCRE2_EXTRA_ESCAPED_CR_IS_LF 2018-09-21 16:59:48 +00:00
Philip.Hazel a69267246f Implement callouts from pcre2_substitute(). 2018-09-18 16:31:30 +00:00
Philip.Hazel 3fce7c75e9 Add "allvector" to pcre2test. 2018-09-15 17:10:39 +00:00
Philip.Hazel 1a8cc3dab6 Make bcopy() emulation of memmove() work properly. 2018-08-10 16:27:44 +00:00
Philip.Hazel 192b82cf6e Allow :NAME on (*ACCEPT), (*FAIL), and (*COMMIT) and fix bug with (*MARK)
followed by (*ACCEPT) in an assertion. More small updates to perltest.sh.
2018-07-21 14:34:51 +00:00
Philip.Hazel 1c79bdf36f Fix global search/replace in pcre2test and pcre2_substitute() when the pattern
matches an empty string, but never at the starting offset.
2018-07-02 10:54:03 +00:00