Revision: 588
http://vcs.pcre.org/viewvc?view=rev&revision=588
Author: ph10
Date: 2011-01-15 11:22:47 +0000 (Sat, 15 Jan 2011)
Log Message:
-----------
Another bugfix for pcregrep with -M and colour.
Modified Paths:
--------------
code/trunk/ChangeLog
code/trunk/NEWS
code/trunk/configure.ac
code/trunk/pcregrep.c
code/trunk/testdata/grepoutput
Modified: code/trunk/ChangeLog
===================================================================
--- code/trunk/ChangeLog 2011-01-14 19:01:25 UTC (rev 587)
+++ code/trunk/ChangeLog 2011-01-15 11:22:47 UTC (rev 588)
@@ -1,7 +1,7 @@
ChangeLog for PCRE
------------------
-Version 8.12 12-Jan-2011
+Version 8.15 12-Jan-2011
------------------------
1. Fixed some typos in the markup of the man pages, and wrote a script that
@@ -9,7 +9,7 @@
2. On a big-endian 64-bit system, pcregrep did not correctly process the
--match-limit and --recursion-limit options (added for 8.11). In
- particular, this made one of the standard tests crash. (The integer value
+ particular, this made one of the standard tests fail. (The integer value
went into the wrong half of a long int.)
3. If the --colour option was given to pcregrep with -v (invert match), it
@@ -24,7 +24,12 @@
matched in multiline mode, the following line was shown as part of the
match. This seems wrong, so I have changed it.
-6. If pcregrep was compiled under Windows, there was a reference to the
+6. Another pcregrep bug in multiline mode, when --colour was specified, caused
+ the check for further matches in the same line (so they could be coloured)
+ to overrun the end of the current line. If another match was found, it was
+ incorrectly shown (and then shown again when found in the next line).
+
+7. If pcregrep was compiled under Windows, there was a reference to the
function pcregrep_exit() before it was defined. I am assuming this was
the cause of the "error C2371: 'pcregrep_exit' : redefinition;" that was
reported by a user. I've moved the definition above the reference.
Modified: code/trunk/NEWS
===================================================================
--- code/trunk/NEWS 2011-01-14 19:01:25 UTC (rev 587)
+++ code/trunk/NEWS 2011-01-15 11:22:47 UTC (rev 588)
@@ -1,6 +1,13 @@
News about PCRE releases
------------------------
+Release 8.12 15-Jan-2011
+------------------------
+
+This release fixes some bugs in pcregrep, one of which caused the tests to fail
+on 64-bit big-endian systems. There are no changes to the code of the library.
+
+
Release 8.11 10-Dec-2010
------------------------
Modified: code/trunk/configure.ac
===================================================================
--- code/trunk/configure.ac 2011-01-14 19:01:25 UTC (rev 587)
+++ code/trunk/configure.ac 2011-01-15 11:22:47 UTC (rev 588)
@@ -11,7 +11,7 @@
m4_define(pcre_major, [8])
m4_define(pcre_minor, [12])
m4_define(pcre_prerelease, [])
-m4_define(pcre_date, [2011-01-12])
+m4_define(pcre_date, [2011-01-15])
# Libtool shared library interface versions (current:revision:age)
m4_define(libpcre_version, [0:1:0])
Modified: code/trunk/pcregrep.c
===================================================================
--- code/trunk/pcregrep.c 2011-01-14 19:01:25 UTC (rev 587)
+++ code/trunk/pcregrep.c 2011-01-15 11:22:47 UTC (rev 588)
@@ -1363,7 +1363,8 @@
last_offset += offsets[1];
matchptr += offsets[1];
length -= offsets[1];
- if (!match_patterns(matchptr, length, offsets, &mrc)) break;
+ if (last_offset >= linelength + endlinelength ||
+ !match_patterns(matchptr, length, offsets, &mrc)) break;
FWRITE(matchptr, 1, offsets[0], stdout);
fprintf(stdout, "%c[%sm", 0x1b, colour_string);
FWRITE(matchptr + offsets[0], 1, offsets[1] - offsets[0], stdout);
Modified: code/trunk/testdata/grepoutput
===================================================================
--- code/trunk/testdata/grepoutput 2011-01-14 19:01:25 UTC (rev 587)
+++ code/trunk/testdata/grepoutput 2011-01-15 11:22:47 UTC (rev 588)
@@ -590,8 +590,6 @@
?[00m?[1;31mtriple: t4_txt s1_tag s_txt p_tag p_txt o_tag o_txt
-?[00m?[1;31mtriple: t4_txt s1_tag s_txt p_tag p_txt o_tag o_txt
-
?[00m?[1;31mtriple: t6_txt s2_tag s_txt p_tag p_txt o_tag o_txt
?[00mRC=0