diff options
author | ph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15> | 2016-06-17 17:28:14 +0000 |
---|---|---|
committer | ph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15> | 2016-06-17 17:28:14 +0000 |
commit | 664df44c7eb62edbce95ab6dbdedcba7f07fed02 (patch) | |
tree | 189645a8ae23bfdcdeff61095b2ec5a1fa0bb2a4 /pcregrep.c | |
parent | 1005d5bd381e441e9afb9ada4cb1006cd666073b (diff) | |
download | pcre-664df44c7eb62edbce95ab6dbdedcba7f07fed02.tar.gz |
Fix bad interaction between -o and -M in pcregrep.
git-svn-id: svn://vcs.exim.org/pcre/code/trunk@1658 2f5784b3-3f2a-0410-8824-cb99058d5e15
Diffstat (limited to 'pcregrep.c')
-rw-r--r-- | pcregrep.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -1803,6 +1803,12 @@ while (ptr < endptr) match = FALSE; if (line_buffered) fflush(stdout); rc = 0; /* Had some success */ + + /* If the current match ended past the end of the line (only possible + in multiline mode), we are done with this line. */ + + if ((unsigned int)offsets[1] > linelength) goto END_ONE_MATCH; + startoffset = offsets[1]; /* Restart after the match */ if (startoffset <= oldstartoffset) { |