Skip to content

Commit cedb976

Browse files
committed
Add test for buffer over-read in pcre2grep
1 parent 55fda7f commit cedb976

File tree

10 files changed

+118
-15
lines changed

10 files changed

+118
-15
lines changed

RunGrepTest

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ fi
4141
valgrind=
4242
while [ $# -gt 0 ] ; do
4343
case $1 in
44-
valgrind) valgrind="valgrind -q --leak-check=no --smc-check=all-non-file";;
44+
valgrind|-valgrind) valgrind="valgrind -q --leak-check=no --smc-check=all-non-file --error-exitcode=70";;
4545
*) echo "RunGrepTest: Unknown argument $1"; exit 1;;
4646
esac
4747
shift
@@ -318,8 +318,11 @@ echo "RC=$?" >>testtrygrep
318318

319319
echo "---------------------------- Test 46 ------------------------------" >>testtrygrep
320320
(cd $srcdir; $valgrind $vjs $pcre2grep -e 'unopened)' -e abc ./testdata/grepinput) >>testtrygrep 2>&1
321+
echo "RC=$?" >>testtrygrep
321322
(cd $srcdir; $valgrind $vjs $pcre2grep -eabc -e '(unclosed' ./testdata/grepinput) >>testtrygrep 2>&1
323+
echo "RC=$?" >>testtrygrep
322324
(cd $srcdir; $valgrind $vjs $pcre2grep -eabc -e xyz -e '[unclosed' ./testdata/grepinput) >>testtrygrep 2>&1
325+
echo "RC=$?" >>testtrygrep
323326
(cd $srcdir; $valgrind $vjs $pcre2grep --regex=123 -eabc -e xyz -e '[unclosed' ./testdata/grepinput) >>testtrygrep 2>&1
324327
echo "RC=$?" >>testtrygrep
325328

@@ -975,31 +978,48 @@ printf 'abc\rdef\r\nghi\njkl' >testNinputgrep
975978

976979
printf '%c--------------------------- Test N1 ------------------------------\r\n' - >testtrygrep
977980
$valgrind $vjs $pcre2grep -n -N CR "^(abc|def|ghi|jkl)" testNinputgrep >>testtrygrep
981+
echo "RC=$?" >>testtrygrep
978982
$valgrind $vjs $pcre2grep -B1 -n -N CR "^def" testNinputgrep >>testtrygrep
983+
echo "RC=$?" >>testtrygrep
979984

980985
printf '%c--------------------------- Test N2 ------------------------------\r\n' - >>testtrygrep
981986
$valgrind $vjs $pcre2grep -n --newline=crlf "^(abc|def|ghi|jkl)" testNinputgrep >>testtrygrep
987+
echo "RC=$?" >>testtrygrep
982988
$valgrind $vjs $pcre2grep -B1 -n -N CRLF "^ghi" testNinputgrep >>testtrygrep
989+
echo "RC=$?" >>testtrygrep
983990

984991
printf '%c--------------------------- Test N3 ------------------------------\r\n' - >>testtrygrep
985992
pattern=`printf 'def\rjkl'`
986993
$valgrind $vjs $pcre2grep -n --newline=cr -F "$pattern" testNinputgrep >>testtrygrep
994+
echo "RC=$?" >>testtrygrep
987995

988996
printf '%c--------------------------- Test N4 ------------------------------\r\n' - >>testtrygrep
989997
$valgrind $vjs $pcre2grep -n --newline=crlf -F -f $srcdir/testdata/greppatN4 testNinputgrep >>testtrygrep
998+
echo "RC=$?" >>testtrygrep
990999

9911000
printf '%c--------------------------- Test N5 ------------------------------\r\n' - >>testtrygrep
9921001
$valgrind $vjs $pcre2grep -n --newline=any "^(abc|def|ghi|jkl)" testNinputgrep >>testtrygrep
1002+
echo "RC=$?" >>testtrygrep
9931003
$valgrind $vjs $pcre2grep -B1 -n --newline=any "^def" testNinputgrep >>testtrygrep
1004+
echo "RC=$?" >>testtrygrep
9941005

9951006
printf '%c--------------------------- Test N6 ------------------------------\r\n' - >>testtrygrep
9961007
$valgrind $vjs $pcre2grep -n --newline=anycrlf "^(abc|def|ghi|jkl)" testNinputgrep >>testtrygrep
1008+
echo "RC=$?" >>testtrygrep
9971009
$valgrind $vjs $pcre2grep -B1 -n --newline=anycrlf "^jkl" testNinputgrep >>testtrygrep
1010+
echo "RC=$?" >>testtrygrep
9981011

9991012
printf '%c--------------------------- Test N7 ------------------------------\r\n' - >>testtrygrep
10001013
printf 'xyz\0abc\0def' >testNinputgrep
10011014
$valgrind $vjs $pcre2grep -na --newline=nul "^(abc|def)" testNinputgrep | $tr '\000' '@' >>testtrygrep
1015+
echo "RC=$?" >>testtrygrep
10021016
$valgrind $vjs $pcre2grep -B1 -na --newline=nul "^(abc|def)" testNinputgrep | $tr '\000' '@' >>testtrygrep
1017+
echo "RC=$?" >>testtrygrep
1018+
1019+
printf '%c--------------------------- Test N8 ------------------------------\r\n' - >>testtrygrep
1020+
$valgrind $vjs $pcre2grep -na --newline=anycrlf "^a" $srcdir/testdata/grepinputBad8_Trail >>testtrygrep
1021+
echo "RC=$?" >>testtrygrep
1022+
10031023
echo "" >>testtrygrep
10041024

10051025
$cf $srcdir/testdata/grepoutputN testtrygrep
@@ -1013,6 +1033,12 @@ if [ $utf8 -ne 0 ] ; then
10131033

10141034
printf '%c--------------------------- Test UN1 ------------------------------\r\n' - >testtrygrep
10151035
$valgrind $vjs $pcre2grep -nau --newline=anycrlf "^(abc|def)" $srcdir/testdata/grepinputUN >>testtrygrep
1036+
echo "RC=$?" >>testtrygrep
1037+
1038+
printf '%c--------------------------- Test UN2 ------------------------------\r\n' - >testtrygrep
1039+
$valgrind $vjs $pcre2grep -nauU --newline=anycrlf "^a" $srcdir/testdata/grepinputBad8_Trail >>testtrygrep
1040+
echo "RC=$?" >>testtrygrep
1041+
10161042
echo "" >>testtrygrep
10171043

10181044
$cf $srcdir/testdata/grepoutputUN testtrygrep
@@ -1031,16 +1057,22 @@ if $valgrind $vjs $pcre2grep --help | $valgrind $vjs $pcre2grep -q 'callout scri
10311057
echo "Testing pcre2grep script callouts"
10321058
echo "--- Test 1 ---" >testtrygrep
10331059
$valgrind $vjs $pcre2grep '(T)(..(.))(?C"/bin/echo|Arg1: [$1] [$2] [$3]|Arg2: $|${1}$| ($4) ($14) ($0)")()' $srcdir/testdata/grepinputv >>testtrygrep
1060+
echo "RC=$?" >>testtrygrep
10341061
echo "--- Test 2 ---" >>testtrygrep
10351062
$valgrind $vjs $pcre2grep '(T)(..(.))()()()()()()()(..)(?C"/bin/echo|Arg1: [$11] [${11}]")' $srcdir/testdata/grepinputv >>testtrygrep
1063+
echo "RC=$?" >>testtrygrep
10361064
echo "--- Test 3 ---" >>testtrygrep
10371065
$valgrind $vjs $pcre2grep '(T)(?C"|$0:$1$n")' $srcdir/testdata/grepinputv >>testtrygrep
1066+
echo "RC=$?" >>testtrygrep
10381067
echo "--- Test 4 ---" >>testtrygrep
10391068
$valgrind $vjs $pcre2grep '(T)(?C"/bin/echo|$0:$1$n")' $srcdir/testdata/grepinputv >>testtrygrep
1069+
echo "RC=$?" >>testtrygrep
10401070
echo "--- Test 5 ---" >>testtrygrep
10411071
$valgrind $vjs $pcre2grep '(T)(?C"|$1$n")(*F)' $srcdir/testdata/grepinputv >>testtrygrep
1072+
echo "RC=$?" >>testtrygrep
10421073
echo "--- Test 6 ---" >>testtrygrep
10431074
$valgrind $vjs $pcre2grep -m1 '(T)(?C"|$0:$1:$x{41}$o{101}$n")' $srcdir/testdata/grepinputv >>testtrygrep
1075+
echo "RC=$?" >>testtrygrep
10441076

10451077
if $valgrind $vjs $pcre2grep --help | $valgrind $vjs $pcre2grep -q 'Non-fork callout scripts in patterns are supported'; then
10461078
nonfork=1
@@ -1057,8 +1089,10 @@ if $valgrind $vjs $pcre2grep --help | $valgrind $vjs $pcre2grep -q 'callout scri
10571089
echo "Testing pcre2grep script callout with UTF-8 features"
10581090
echo "--- Test 1 ---" >testtrygrep
10591091
$valgrind $vjs $pcre2grep -u '(T)(?C"|$0:$x{a6}$n")' $srcdir/testdata/grepinputv >>testtrygrep
1092+
echo "RC=$?" >>testtrygrep
10601093
echo "--- Test 2 ---" >>testtrygrep
10611094
$valgrind $vjs $pcre2grep -u '(T)(?C"/bin/echo|$0:$x{a6}$n")' $srcdir/testdata/grepinputv >>testtrygrep
1095+
echo "RC=$?" >>testtrygrep
10621096

10631097
if [ $nonfork = 1 ] ; then
10641098
$cf $srcdir/testdata/grepoutputCNU testtrygrep

RunGrepTest.bat

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,8 +281,11 @@ echo RC=^%ERRORLEVEL%>>testtrygrep
281281

282282
echo ---------------------------- Test 46 ------------------------------>>testtrygrep
283283
(pushd %srcdir% & %pcre2grep% -e "unopened)" -e abc ./testdata/grepinput & popd) >>testtrygrep 2>&1
284+
echo RC=^%ERRORLEVEL%>>testtrygrep
284285
(pushd %srcdir% & %pcre2grep% -eabc -e "(unclosed" ./testdata/grepinput & popd) >>testtrygrep 2>&1
286+
echo RC=^%ERRORLEVEL%>>testtrygrep
285287
(pushd %srcdir% & %pcre2grep% -eabc -e xyz -e "[unclosed" ./testdata/grepinput & popd) >>testtrygrep 2>&1
288+
echo RC=^%ERRORLEVEL%>>testtrygrep
286289
(pushd %srcdir% & %pcre2grep% --regex=123 -eabc -e xyz -e "[unclosed" ./testdata/grepinput & popd) >>testtrygrep 2>&1
287290
echo RC=^%ERRORLEVEL%>>testtrygrep
288291

@@ -937,31 +940,48 @@ echo Testing pcre2grep newline settings
937940

938941
echo ---------------------------- Test N1 ------------------------------>testtrygrep
939942
%pcre2grep% -n -N CR "^(abc|def|ghi|jkl)" testNinputgrep >>testtrygrep
943+
echo RC=^%ERRORLEVEL%>>testtrygrep
940944
%pcre2grep% -B1 -n -N CR "^def" testNinputgrep >>testtrygrep
945+
echo RC=^%ERRORLEVEL%>>testtrygrep
941946

942947
echo ---------------------------- Test N2 ------------------------------>>testtrygrep
943948
%pcre2grep% -n --newline=crlf "^(abc|def|ghi|jkl)" testNinputgrep >>testtrygrep
949+
echo RC=^%ERRORLEVEL%>>testtrygrep
944950
%pcre2grep% -B1 -n -N CRLF "^ghi" testNinputgrep >>testtrygrep
951+
echo RC=^%ERRORLEVEL%>>testtrygrep
945952

946953
echo ---------------------------- Test N3 ------------------------------>>testtrygrep
947954
for /f %%a in ('%printf% "def\rjkl"') do set pattern=%%a
948955
%pcre2grep% -n --newline=cr -F "!pattern!" testNinputgrep >>testtrygrep
956+
echo RC=^%ERRORLEVEL%>>testtrygrep
949957

950958
echo ---------------------------- Test N4 ------------------------------>>testtrygrep
951959
%pcre2grep% -n --newline=crlf -F -f %srcdir%\testdata\greppatN4 testNinputgrep >>testtrygrep
960+
echo RC=^%ERRORLEVEL%>>testtrygrep
952961

953962
echo ---------------------------- Test N5 ------------------------------>>testtrygrep
954963
%pcre2grep% -n --newline=any "^(abc|def|ghi|jkl)" testNinputgrep >>testtrygrep
964+
echo RC=^%ERRORLEVEL%>>testtrygrep
955965
%pcre2grep% -B1 -n --newline=any "^def" testNinputgrep >>testtrygrep
966+
echo RC=^%ERRORLEVEL%>>testtrygrep
956967

957968
echo ---------------------------- Test N6 ------------------------------>>testtrygrep
958969
%pcre2grep% -n --newline=anycrlf "^(abc|def|ghi|jkl)" testNinputgrep >>testtrygrep
970+
echo RC=^%ERRORLEVEL%>>testtrygrep
959971
%pcre2grep% -B1 -n --newline=anycrlf "^jkl" testNinputgrep >>testtrygrep
972+
echo RC=^%ERRORLEVEL%>>testtrygrep
960973

961974
echo ---------------------------- Test N7 ------------------------------>>testtrygrep
962975
%printf% "xyz\0abc\0def" >testNinputgrep
963976
%pcre2grep% -na --newline=nul "^(abc|def)" testNinputgrep | %trnull% >>testtrygrep
977+
echo RC=^%ERRORLEVEL%>>testtrygrep
964978
%pcre2grep% -B1 -na --newline=nul "^(abc|def)" testNinputgrep | %trnull% >>testtrygrep
979+
echo RC=^%ERRORLEVEL%>>testtrygrep
980+
981+
echo ---------------------------- Test N8 ------------------------------>>testtrygrep
982+
%pcre2grep% -na --newline=anycrlf "^a" %srcdir%\testdata\grepinputBad8_Trail >>testtrygrep
983+
echo RC=^%ERRORLEVEL%>>testtrygrep
984+
965985
%printf% "\n" >>testtrygrep
966986

967987
%cf% %srcdir%\testdata\grepoutputN testtrygrep %cfout%
@@ -975,6 +995,12 @@ if %utf8% neq 0 (
975995

976996
echo ---------------------------- Test UN1 ------------------------------>testtrygrep
977997
%pcre2grep% -nau --newline=anycrlf "^(abc|def)" %srcdir%\testdata\grepinputUN >>testtrygrep
998+
echo RC=^!ERRORLEVEL!>>testtrygrep
999+
1000+
echo ---------------------------- Test UN2 ------------------------------>testtrygrep
1001+
%pcre2grep% -nauU --newline=anycrlf "^a" %srcdir%\testdata\grepinputBad8_Trail >>testtrygrep
1002+
echo RC=^!ERRORLEVEL!>>testtrygrep
1003+
9781004
%printf% "\n" >>testtrygrep
9791005

9801006
%cf% %srcdir%\testdata\grepoutputUN testtrygrep %cfout%
@@ -996,16 +1022,22 @@ if %ERRORLEVEL% equ 0 (
9961022

9971023
echo --- Test 1 --->testtrygrep
9981024
%pcre2grep% "(T)(..(.))(?C'cmd|/c echo|Arg1: [$1] [$2] [$3]|Arg2: ^$|${1}^$| ($4) ($14) ($0)')()" %srcdir%\testdata\grepinputv >>testtrygrep
1025+
echo RC=^!ERRORLEVEL!>>testtrygrep
9991026
echo --- Test 2 --->>testtrygrep
10001027
%pcre2grep% "(T)(..(.))()()()()()()()(..)(?C'cmd|/c echo|Arg1: [$11] [${11}]')" %srcdir%\testdata\grepinputv >>testtrygrep
1028+
echo RC=^!ERRORLEVEL!>>testtrygrep
10011029
echo --- Test 3 --->>testtrygrep
10021030
%pcre2grep% "(T)(?C'|$0:$1$n')" %srcdir%\testdata\grepinputv >>testtrygrep
1031+
echo RC=^!ERRORLEVEL!>>testtrygrep
10031032
echo --- Test 4 --->>testtrygrep
10041033
%pcre2grep% "(T)(?C'cscript|//nologo|printf.js|%%s\r\n|$0:$1$n')" %srcdir%\testdata\grepinputv >>testtrygrep
1034+
echo RC=^!ERRORLEVEL!>>testtrygrep
10051035
echo --- Test 5 --->>testtrygrep
10061036
%pcre2grep% "(T)(?C'|$1$n')(*F)" %srcdir%\testdata\grepinputv >>testtrygrep
1037+
echo RC=^!ERRORLEVEL!>>testtrygrep
10071038
echo --- Test 6 --->>testtrygrep
10081039
%pcre2grep% -m1 "(T)(?C'|$0:$1:$x{41}$o{101}$n')" %srcdir%\testdata\grepinputv >>testtrygrep
1040+
echo RC=^!ERRORLEVEL!>>testtrygrep
10091041

10101042
%pcre2grep% --help | %pcre2grep% -q "Non-fork callout scripts in patterns are supported"
10111043
if ^!ERRORLEVEL! equ 0 (
@@ -1024,8 +1056,10 @@ if %ERRORLEVEL% equ 0 (
10241056

10251057
echo --- Test 1 --->testtrygrep
10261058
%pcre2grep% -u "(T)(?C'|$0:$x{a6}$n')" %srcdir%\testdata\grepinputv >>testtrygrep
1059+
echo RC=^!ERRORLEVEL!>>testtrygrep
10271060
echo --- Test 2 --->>testtrygrep
10281061
%pcre2grep% -u "(T)(?C'cscript|//nologo|printf.js|%%s\r\n|$0:$x{a6}$n')" %srcdir%\testdata\grepinputv >>testtrygrep
1062+
echo RC=^!ERRORLEVEL!>>testtrygrep
10291063

10301064
if ^!nonfork! equ 1 (
10311065
%cf% %srcdir%\testdata\grepoutputCNU testtrygrep %cfout%

RunTest

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ while [ $# -gt 0 ] ; do
288288
bigstack|-bigstack) bigstack=yes;;
289289
nojit|-nojit) nojit=yes;;
290290
sim|-sim) shift; sim=$1;;
291-
valgrind|-valgrind) valgrind="valgrind --tool=memcheck -q --smc-check=all-non-file";;
291+
valgrind|-valgrind) valgrind="valgrind --tool=memcheck -q --smc-check=all-non-file --error-exitcode=70";;
292292
valgrind-log|-valgrind-log) valgrind="valgrind --tool=memcheck --num-callers=30 --leak-check=no --error-limit=no --smc-check=all-non-file --log-file=report.%p ";;
293293
~*)
294294
if expr "$1" : '~[0-9][0-9]*$' >/dev/null; then

src/pcre2grep.c

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,9 @@ POSSIBILITY OF SUCH DAMAGE.
9999
#include <bzlib.h>
100100
#endif
101101

102-
#include "pcre2_util.h"
103-
104102
#define PCRE2_CODE_UNIT_WIDTH 8
105103
#include "pcre2.h"
104+
#include "pcre2_internal.h"
106105

107106
/* Older versions of MSVC lack snprintf(). This define allows for
108107
warning/error-free compilation and testing with MSVC compilers back to at least
@@ -126,11 +125,6 @@ be C99 don't support it (hence DISABLE_PERCENT_ZT). */
126125
#define SIZ_FORM "zu"
127126
#endif
128127

129-
#define FALSE 0
130-
#define TRUE 1
131-
132-
typedef int BOOL;
133-
134128
#define DEFAULT_CAPTURE_MAX 50
135129

136130
#if BUFSIZ > 8192
@@ -2588,6 +2582,7 @@ static PCRE2_SIZE
25882582
fill_buffer(void *handle, int frtype, char *buffer, PCRE2_SIZE length,
25892583
BOOL input_line_buffered)
25902584
{
2585+
PCRE2_SIZE nread;
25912586
(void)frtype; /* Avoid warning when not used */
25922587

25932588
#ifdef SUPPORT_LIBZ
@@ -2602,9 +2597,16 @@ if (frtype == FR_LIBBZ2)
26022597
else
26032598
#endif
26042599

2605-
return (input_line_buffered ?
2600+
nread = (input_line_buffered ?
26062601
read_one_line(buffer, length, (FILE *)handle) :
26072602
fread(buffer, 1, length, (FILE *)handle));
2603+
2604+
#ifdef SUPPORT_VALGRIND
2605+
if (nread > 0) VALGRIND_MAKE_MEM_DEFINED_IF_ADDRESSABLE(buffer, nread);
2606+
if (nread < length) VALGRIND_MAKE_MEM_UNDEFINED(buffer + nread, length - nread);
2607+
#endif
2608+
2609+
return nread;
26082610
}
26092611

26102612

testdata/grepinputBad8_Trail

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
abc�

testdata/grepoutput

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -436,8 +436,11 @@ RC=0
436436
RC=0
437437
---------------------------- Test 46 ------------------------------
438438
pcre2grep: Error in 1st command-line regex at offset 8: unmatched closing parenthesis
439+
RC=2
439440
pcre2grep: Error in 2nd command-line regex at offset 9: missing closing parenthesis
441+
RC=2
440442
pcre2grep: Error in 3rd command-line regex at offset 9: missing terminating ] for character class
443+
RC=2
441444
pcre2grep: Error in 4th command-line regex at offset 9: missing terminating ] for character class
442445
RC=2
443446
---------------------------- Test 47 ------------------------------
@@ -494,6 +497,7 @@ RC=0
494497
./testdata/grepinput3:0
495498
./testdata/grepinput8:0
496499
./testdata/grepinputBad8:0
500+
./testdata/grepinputBad8_Trail:0
497501
./testdata/grepinputM:0
498502
./testdata/grepinputUN:0
499503
./testdata/grepinputv:1
@@ -725,6 +729,7 @@ RC=0
725729
./testdata/grepinput3
726730
./testdata/grepinput8
727731
./testdata/grepinputBad8
732+
./testdata/grepinputBad8_Trail
728733
./testdata/grepinputx
729734
RC=0
730735
---------------------------- Test 97 -----------------------------
@@ -837,6 +842,7 @@ testdata/grepinput:469
837842
testdata/grepinput3:0
838843
testdata/grepinput8:0
839844
testdata/grepinputBad8:0
845+
testdata/grepinputBad8_Trail:0
840846
testdata/grepinputM:2
841847
testdata/grepinputUN:0
842848
testdata/grepinputv:3
@@ -858,6 +864,7 @@ RC=0
858864
0
859865
0
860866
0
867+
0
861868
2
862869
0
863870
3
@@ -868,6 +875,7 @@ RC=0
868875
testdata/grepinput3
869876
testdata/grepinput8
870877
testdata/grepinputBad8
878+
testdata/grepinputBad8_Trail
871879
testdata/grepinputUN
872880
RC=0
873881
---------------------------- Test 119 -----------------------------

testdata/grepoutputC

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ Arg1: [T] [he ] [ ] Arg2: |T| () () (0)
1111
The caterpillar sat on the mat
1212
Arg1: [T] [he ] [ ] Arg2: |T| () () (0)
1313
The snowcat is not an animal
14+
RC=0
1415
--- Test 2 ---
1516
Arg1: [qu] [qu]
1617
The quick brown
@@ -24,6 +25,7 @@ Arg1: [ca] [ca]
2425
The caterpillar sat on the mat
2526
Arg1: [sn] [sn]
2627
The snowcat is not an animal
28+
RC=0
2729
--- Test 3 ---
2830
0:T
2931
The quick brown
@@ -37,6 +39,7 @@ The word is cat in this line
3739
The caterpillar sat on the mat
3840
0:T
3941
The snowcat is not an animal
42+
RC=0
4043
--- Test 4 ---
4144
0:T
4245

@@ -56,13 +59,16 @@ The caterpillar sat on the mat
5659
0:T
5760

5861
The snowcat is not an animal
62+
RC=0
5963
--- Test 5 ---
6064
T
6165
T
6266
T
6367
T
6468
T
6569
T
70+
RC=1
6671
--- Test 6 ---
6772
0:T:AA
6873
The quick brown
74+
RC=0

testdata/grepoutputCU

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ The word is cat in this line
1111
The caterpillar sat on the mat
1212
0:¦
1313
The snowcat is not an animal
14+
RC=0
1415
--- Test 2 ---
1516
0:¦
1617

@@ -30,3 +31,4 @@ The caterpillar sat on the mat
3031
0:¦
3132

3233
The snowcat is not an animal
34+
RC=0

0 commit comments

Comments
 (0)