diff options
author | Russ Cox <rsc@swtch.com> | 2009-02-04 20:13:18 -0800 |
---|---|---|
committer | Russ Cox <rsc@swtch.com> | 2009-02-04 20:13:18 -0800 |
commit | ee85defda48d1d6b7c18b9fab7140c6598d2f658 (patch) | |
tree | 737239578831c526e7a1e0710c35d197fdb9712e | |
parent | 1adb2a07bff16932f070a29af8460c35be34fb65 (diff) | |
download | plan9port-ee85defda48d1d6b7c18b9fab7140c6598d2f658.tar.gz plan9port-ee85defda48d1d6b7c18b9fab7140c6598d2f658.tar.bz2 plan9port-ee85defda48d1d6b7c18b9fab7140c6598d2f658.zip |
sed: avoid crash when rregexec return error
-rw-r--r-- | src/cmd/sed.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cmd/sed.c b/src/cmd/sed.c index a463e071..5849c83f 100644 --- 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; |