bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: grep segfault


From: Stepan Kasal
Subject: Re: grep segfault
Date: Tue, 2 Sep 2003 13:42:47 +0200
User-agent: Mutt/1.2.5.1i

Hello,
        thank you very much for thorough analysis.

On Tue, Sep 02, 2003 at 12:12:24PM +0000, Martin Bays wrote:
> It looks like the problem occurs when the final newline in the buffer is
> matched by the pattern.

For grep, I think that the answer is simple: the newline should never
be matched,

> But I'm not sure what *should* happen. Are we meant to be able to match
> the final newline? Should we even be in multi-line mode at all (as set in

as we shouldn't be in multiline mode.  Traditional grep wasn't multiline
and, IMHO, making grep -P would bring too much problems to be maintainable.

So you have discovered a bug in grep source.

The problem is that even if I get the flags right, the user still has the
ability to get to multiline mode via the (?..) syntax. (Sorry if I'm wrong,
my knowledge of perl regexps is still very weak, unfortunately.)
I see no better way to fix it than just document that switching to
multiline mode is not allowed.  (Suggestions?)

Thank you again for the explanation.  I will fix it is ASAP.

Stepan Kasal




reply via email to

[Prev in Thread] Current Thread [Next in Thread]