svn commit: r303065 - stable/10/usr.bin/sed

Pedro F. Giffuni pfg at FreeBSD.org
Wed Jul 20 04:49:03 UTC 2016


Author: pfg
Date: Wed Jul 20 04:49:01 2016
New Revision: 303065
URL: https://svnweb.freebsd.org/changeset/base/303065

Log:
  MFC r302973:
  sed(1): Fix off by one introduced in r299211.
  
  Detected by running the gsed tests.
  
  Submitted by:	Mikhail Teterin
  PR:		195929

Modified:
  stable/10/usr.bin/sed/process.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/usr.bin/sed/process.c
==============================================================================
--- stable/10/usr.bin/sed/process.c	Wed Jul 20 04:45:59 2016	(r303064)
+++ stable/10/usr.bin/sed/process.c	Wed Jul 20 04:49:01 2016	(r303065)
@@ -440,7 +440,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-stable mailing list