diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 112f82d..28c54f9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -19,5 +19,40 @@ jobs: - name: Build run: make - - name: Test - run: make check + - name: Test (main test script) + run: ./RunTest + + - name: Test (JIT test program) + run: ./pcre2_jit_test + + - name: Test (pcre2grep test script) + run: ./RunGrepTest + + alpine: + name: alpine + runs-on: ubuntu-latest + container: alpine + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Autotools + run: apk add --no-cache automake autoconf gcc libtool make musl-dev + + - name: Autogen + run: ./autogen.sh + + - name: Configure + run: ./configure --enable-jit --enable-pcre2-8 --enable-pcre2-16 --enable-pcre2-32 + + - name: Build + run: make + + - name: Test (main test script) + run: ./RunTest + + - name: Test (JIT test program) + run: ./pcre2_jit_test + + - name: Test (pcre2grep test script) + run: ./RunGrepTest diff --git a/ChangeLog b/ChangeLog index 856250f..5453ecc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,14 @@ Change Log for PCRE2 -------------------- +Version 10.41 xx-xxx-2022 +------------------------- + +1. Add fflush() before and after a fork callout in pcre2grep to get its output +to be the same on all systems. (THere were previously ordering differences in +Alpine Linux). + + Version 10.40 15-April-2022 --------------------------- diff --git a/src/pcre2grep.c b/src/pcre2grep.c index 2335d0d..030e50d 100644 --- a/src/pcre2grep.c +++ b/src/pcre2grep.c @@ -13,7 +13,7 @@ distribution because other apparatus is needed to compile pcre2grep for z/OS. The header can be found in the special z/OS distribution, which is available from www.zaconsultants.net or from www.cbttape.org. - Copyright (c) 1997-2020 University of Cambridge + Copyright (c) 1997-2022 University of Cambridge ----------------------------------------------------------------------------- Redistribution and use in source and binary forms, with or without @@ -2437,7 +2437,11 @@ if (pid == 0) exit(1); } else if (pid > 0) + { + (void)fflush(stdout); (void)waitpid(pid, &result, 0); + (void)fflush(stdout); + } #endif /* End Windows/VMS/other handling */ free(args); diff --git a/testdata/grepoutputC b/testdata/grepoutputC index 87897f0..9255c0a 100644 --- a/testdata/grepoutputC +++ b/testdata/grepoutputC @@ -1,26 +1,26 @@ Arg1: [T] [he ] [ ] Arg2: |T| () () (0) -Arg1: [T] [his] [s] Arg2: |T| () () (0) -Arg1: [T] [his] [s] Arg2: |T| () () (0) -Arg1: [T] [he ] [ ] Arg2: |T| () () (0) -Arg1: [T] [he ] [ ] Arg2: |T| () () (0) -Arg1: [T] [he ] [ ] Arg2: |T| () () (0) The quick brown +Arg1: [T] [his] [s] Arg2: |T| () () (0) This time it jumps and jumps and jumps. +Arg1: [T] [his] [s] Arg2: |T| () () (0) This line contains \E and (regex) *meta* [characters]. +Arg1: [T] [he ] [ ] Arg2: |T| () () (0) The word is cat in this line +Arg1: [T] [he ] [ ] Arg2: |T| () () (0) The caterpillar sat on the mat +Arg1: [T] [he ] [ ] Arg2: |T| () () (0) The snowcat is not an animal Arg1: [qu] [qu] -Arg1: [ t] [ t] -Arg1: [ l] [ l] -Arg1: [wo] [wo] -Arg1: [ca] [ca] -Arg1: [sn] [sn] The quick brown +Arg1: [ t] [ t] This time it jumps and jumps and jumps. +Arg1: [ l] [ l] This line contains \E and (regex) *meta* [characters]. +Arg1: [wo] [wo] The word is cat in this line +Arg1: [ca] [ca] The caterpillar sat on the mat +Arg1: [sn] [sn] The snowcat is not an animal 0:T The quick brown