plan9port

[fork] Plan 9 from user space
git clone git://src.adamsgaard.dk/plan9port # fast
git clone https://src.adamsgaard.dk/plan9port.git # slow
Log | Files | Refs | README | LICENSE Back to index

commit ee85defda48d1d6b7c18b9fab7140c6598d2f658
parent 1adb2a07bff16932f070a29af8460c35be34fb65
Author: Russ Cox <rsc@swtch.com>
Date:   Wed,  4 Feb 2009 20:13:18 -0800

sed: avoid crash when rregexec return error

Diffstat:
Msrc/cmd/sed.c | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/cmd/sed.c b/src/cmd/sed.c @@ -994,7 +994,7 @@ match(Reprog *pattern, Rune *buf) return 0; subexp[0].s.rsp = buf; subexp[0].e.rep = 0; - if (rregexec(pattern, linebuf, subexp, MAXSUB)) { + if (rregexec(pattern, linebuf, subexp, MAXSUB) > 0) { loc1 = subexp[0].s.rsp; loc2 = subexp[0].e.rep; return 1;