From 4050676ed976646234e66c536f086056fe7274cb Mon Sep 17 00:00:00 2001 From: ph10 Date: Mon, 4 Jan 2021 17:17:48 +0000 Subject: Update RunGrepTest to use tr for handling binary zeros instead of sed, which it is hoped with increase portability. Bugzilla #2681. git-svn-id: svn://vcs.exim.org/pcre2/code/trunk@1289 6239d852-aaf2-0410-a92c-79f79f948069 --- ChangeLog | 13 +++++++++++-- RunGrepTest | 11 +++-------- testdata/grepoutputN | 2 +- 3 files changed, 15 insertions(+), 11 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2e20bdb..58e7ae4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,8 +1,17 @@ Change Log for PCRE2 -------------------- -Version 10.36-RC1 04-December-2020 ----------------------------------- +Version 10.37-RC1 04-January-2021 +--------------------------------- + +1. Change RunGrepTest to use tr instead of sed when testing with binary +zero bytes, because sed varies a lot from system to system and has problems +with binary zeros. This is from Bugzilla #2681. Patch from Jeremie +Courreges-Anglas via Nam Nguyen. This fixes RunGrepTest for OpenBSD. + + +Version 10.36 04-December-2020 +------------------------------ 1. Add CET_CFLAGS so that when Intel CET is enabled, pass -mshstk to compiler. This fixes https://bugs.exim.org/show_bug.cgi?id=2578. Patch for diff --git a/RunGrepTest b/RunGrepTest index 4d514e4..1e319c9 100755 --- a/RunGrepTest +++ b/RunGrepTest @@ -763,14 +763,9 @@ $valgrind $vjs $pcre2grep -n --newline=anycrlf "^(abc|def|ghi|jkl)" testNinputgr # doesn't. printf '%c--------------------------- Test N7 ------------------------------\r\n' - >>testtrygrep -Z=`printf '\0' | sed 's/\x00/Z/g'` -if [ "$Z" = "Z" ]; then - printf 'abc\0def' >testNinputgrep - $valgrind $vjs $pcre2grep -na --newline=nul "^(abc|def)" testNinputgrep | sed 's/\x00/ZERO/g' >>testtrygrep - echo "" >>testtrygrep -else - echo '1:abcZERO2:defZERO' >>testtrygrep -fi +printf 'abc\0def' >testNinputgrep +$valgrind $vjs $pcre2grep -na --newline=nul "^(abc|def)" testNinputgrep | tr '\000' '@' >>testtrygrep +echo "" >>testtrygrep $cf $srcdir/testdata/grepoutputN testtrygrep if [ $? != 0 ] ; then exit 1; fi diff --git a/testdata/grepoutputN b/testdata/grepoutputN index caaeb75..811c52d 100644 --- a/testdata/grepoutputN +++ b/testdata/grepoutputN @@ -18,4 +18,4 @@ jkl 3:ghi 4:jkl ---------------------------- Test N7 ------------------------------ -1:abcZERO2:defZERO +1:abc@2:def@ -- cgit v1.2.1