svn commit: r302973 - head/usr.bin/sed

Pedro F. Giffuni pfg at FreeBSD.org
Sun Jul 17 21:49:55 UTC 2016


Author: pfg
Date: Sun Jul 17 21:49:53 2016
New Revision: 302973
URL: https://svnweb.freebsd.org/changeset/base/302973

Log:
  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

Modified:
  head/usr.bin/sed/process.c

Modified: head/usr.bin/sed/process.c
==============================================================================
--- head/usr.bin/sed/process.c	Sun Jul 17 20:34:46 2016	(r302972)
+++ head/usr.bin/sed/process.c	Sun Jul 17 21:49:53 2016	(r302973)
@@ -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. */


More information about the svn-src-head mailing list