On 10/23/2010 09:49 AM, Kai YU wrote:
Hi, recently I noticed the Debain Bug #532541(
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=532541). The problem
reported still exists in grep-2.7. I debugged the program, and found it was
introduce by the change of grep-2.5.3(
http://git.savannah.gnu.org/cgit/grep.git/commit/?id=143f885e02eb98ab88a1f18e0aa8d069781bc813).
The failure-inducing change is:
- if (only_matching)
+}
+
+static void
+prline (char const *beg, char const *lim, int sep)
+{
+ if (!only_matching)
+ print_line_head(beg, lim, sep);
+ else
Notice that the predicate if (only_matching) is changed to if
(!only_matching).
The patch is correct in adding the "!". The code previously was doing
static void prline(...)
{
/* do something */
if (only_matching)
/* do something else */
}
now it is
static void print_line_head(...)
{
/* do something */
}
static void prline(...)
{
if (!only_matching)
print_line_head(...)
else
/* do something else */
}
So the condition for "/* do something else */" hasn't changed.
Still, I agree there is a bug there and I'm looking into it.
Paolo
--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org