From 4386fba70c44066b3ab11d29a42900f79713993d Mon Sep 17 00:00:00 2001 From: "Pedro F. Giffuni" 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 b70a492349ad..33eea13bac5f 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. */