Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 22 Jul 2016 19:36:11 +0000 (UTC)
From:      "Andrey A. Chernov" <ache@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject:   svn commit: r303201 - stable/10/usr.bin/tr
Message-ID:  <201607221936.u6MJaBC6040952@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ache
Date: Fri Jul 22 19:36:11 2016
New Revision: 303201
URL: https://svnweb.freebsd.org/changeset/base/303201

Log:
  MFC: r302827
  
  Optimize [Cc]flag case: don't repeatedly add the last character of
  string2 to squeeze cset when string2 reach its EOS state.

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

Modified: stable/10/usr.bin/tr/tr.c
==============================================================================
--- stable/10/usr.bin/tr/tr.c	Fri Jul 22 19:34:43 2016	(r303200)
+++ stable/10/usr.bin/tr/tr.c	Fri Jul 22 19:36:11 2016	(r303201)
@@ -272,10 +272,11 @@ endloop:
 			if (Cflag && !iswrune(cnt))
 				continue;
 			if (cmap_lookup(map, cnt) == OOBCH) {
-				if (next(&s2))
+				if (next(&s2)) {
 					cmap_add(map, cnt, s2.lastch);
-				if (sflag)
-					cset_add(squeeze, s2.lastch);
+					if (sflag)
+						cset_add(squeeze, s2.lastch);
+				}
 			} else
 				cmap_add(map, cnt, cnt);
 			if ((s2.state == EOS || s2.state == INFINITE) &&



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201607221936.u6MJaBC6040952>