mirror of
https://github.com/9fans/plan9port.git
synced 2025-01-27 11:52:03 +00:00
sed: avoid crash when rregexec return error
This commit is contained in:
parent
1adb2a07bf
commit
ee85defda4
1 changed files with 1 additions and 1 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue