From 399d1617d8a00da0597fd636688074801f857def Mon Sep 17 00:00:00 2001 From: pfg Date: Sun, 17 Jul 2016 21:49:53 +0000 Subject: [PATCH] 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 --- usr.bin/sed/process.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.bin/sed/process.c b/usr.bin/sed/process.c index b70a492349a..33eea13bac5 100644 --- a/usr.bin/sed/process.c +++ b/usr.bin/sed/process.c @@ -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. */ -- 2.11.4.GIT