[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug-grep] segfault bug running grep -P when pattern matches last eol
From: |
Claudio Fontana |
Subject: |
[bug-grep] segfault bug running grep -P when pattern matches last eol |
Date: |
Tue, 22 Feb 2005 19:08:40 +0100 (CET) |
Hello,
I've investigated the problem about the grep -P
segfault bug further, and I've understood that it
happens when the perlre pattern matches the last eol.
What happens is that the current code (in
search.c::Pexecute()) assumes that a newline is always
present after the match.
This is not always the case (even considering grep
adds a \n at the eof when not present), because the
match can include the \n, and the end pointer is set
after the match.
I include a tiny patch to fix the problem.
Claudio
___________________________________
Nuovo Yahoo! Messenger: E' molto più divertente: Audibles, Avatar, Webcam,
Giochi, Rubrica
Scaricalo ora!
http://it.messenger.yahoo.it
pgrep_consider_eof.patch
Description: pgrep_consider_eof.patch