sed(1): Fix off by one introduced in r299211.

Detected by running the gsed tests.

Submitted by:	Mikhail Teterin
PR:		195929
MFC after:	3 days
This commit is contained in:
Pedro F. Giffuni 2016-07-17 21:49:53 +00:00
parent d73abd4b09
commit 4386fba70c
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=302973

View File

@ -450,7 +450,7 @@ substitute(struct s_command *cp)
regexec_e(re, ps, REG_NOTBOL, 0, le, psl));
/* Did not find the requested number of matches. */
if (n > 1)
if (n > 0)
return (0);
/* Copy the trailing retained string. */