svn commit: r303064 - stable/11/usr.bin/sed

Pedro F. Giffuni pfg at FreeBSD.org
Wed Jul 20 04:46:01 UTC 2016


Author: pfg
Date: Wed Jul 20 04:45:59 2016
New Revision: 303064
URL: https://svnweb.freebsd.org/changeset/base/303064

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

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

Modified: stable/11/usr.bin/sed/process.c
==============================================================================
--- stable/11/usr.bin/sed/process.c	Wed Jul 20 04:25:09 2016	(r303063)
+++ stable/11/usr.bin/sed/process.c	Wed Jul 20 04:45:59 2016	(r303064)
@@ -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-stable mailing list