From owner-svn-src-all@freebsd.org Fri Nov 3 13:45:20 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9EAD5E52AD5; Fri, 3 Nov 2017 13:45:20 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from smtp-out-no.shaw.ca (smtp-out-no.shaw.ca [64.59.134.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 55371652B4; Fri, 3 Nov 2017 13:45:19 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from spqr.komquats.com ([96.50.22.10]) by shaw.ca with SMTP id AcHWexbLGI8mCAcHXeI0Z1; Fri, 03 Nov 2017 07:45:12 -0600 X-Authority-Analysis: v=2.2 cv=HahkdmM8 c=1 sm=1 tr=0 a=jvE2nwUzI0ECrNeyr98KWA==:117 a=jvE2nwUzI0ECrNeyr98KWA==:17 a=kj9zAlcOel0A:10 a=xqWC_Br6kY4A:10 a=sC3jslCIGhcA:10 a=VxmjJ2MpAAAA:8 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=6qytifEUq2CPgH63iQ8A:9 a=CjuIK1q_8ugA:10 a=7gXAzLPJhVmCkEl4_tsf:22 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTPS id 6326B3B4; Fri, 3 Nov 2017 06:45:10 -0700 (PDT) Received: from slippy (localhost [IPv6:0:0:0:0:0:0:0:1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id vA3DjAPC041708; Fri, 3 Nov 2017 06:45:10 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201711031345.vA3DjAPC041708@slippy.cwsent.com> X-Mailer: exmh version 2.8.0 04/21/2012 with nmh-1.6 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Cy Schubert cc: Cy Schubert , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r325357 - head/lib/libc/stdio In-Reply-To: Message from Cy Schubert of "Fri, 03 Nov 2017 06:15:06 -0700." <201711031315.vA3DF6Oc041175@slippy.cwsent.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Fri, 03 Nov 2017 06:45:10 -0700 X-CMAE-Envelope: MS4wfEnJ388x4Layxm04SZYeHzSpAhW+lCCdBSv8+8JGdCrwYlbcV7bercWquHyGLeEU+n+Dz0TiJWW7poy30NvF02EkOXanQUbLDvt+p1A5NrWtEzN9C0zB j/NJrO0R9dMYt4+klwV3qjjNW+XutZz9PTG6E/bj4xFUWB4J4pca5ovIA7CsG6xLE4vV7UlZzv3DeDlU0rQHBC8frA1OY7UAZCxQYLipvH/+a23S3ynMtML6 D4KeckXUFrzphDdxiFHFNPmiLYZLdL9CtfyB2vDxUUM23jKrRDuUJOwPa//zFSd+ X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Nov 2017 13:45:20 -0000 In message <201711031315.vA3DF6Oc041175@slippy.cwsent.com>, Cy Schubert writes: > In message <201711031308.vA3D8Tj1051559@repo.freebsd.org>, Cy Schubert > writes: > > Author: cy > > Date: Fri Nov 3 13:08:29 2017 > > New Revision: 325357 > > URL: https://svnweb.freebsd.org/changeset/base/325357 > > > > Log: > > While discussing the new gets_s.c in D12785, ed@ suggested putting > > {}'s around the if (c == EOF) block to prevent potential 'trailing else' > > issues from being introduced when refactoring. As my gets_s() code > > is based on this, it makes sense to fix the same issue here first > > here and now, then do an svn copy again to capture this history). > > > > Suggested by: ed@ in D12785 > > > > Modified: > > head/lib/libc/stdio/gets.c > > > > Modified: head/lib/libc/stdio/gets.c > > =========================================================================== > == > > = > > --- head/lib/libc/stdio/gets.c Fri Nov 3 12:52:59 2017 (r32535 > > 6) > > +++ head/lib/libc/stdio/gets.c Fri Nov 3 13:08:29 2017 (r32535 > > 7) > > @@ -61,13 +61,13 @@ gets(char *buf) > > warned = 1; > > } > > for (s = buf; (c = __sgetc(stdin)) != '\n'; ) { > > - if (c == EOF) > > + if (c == EOF) { > > if (s == buf) { > > ret = NULL; > > goto end; > > } else > > break; > > - else > > + } else > > *s++ = c; > > } > > *s = 0; > > This should probably be MFCed too. > > MFC after: 2 weeks Also, apologies to Ed Maste. Credit should go to emaste@ instead of ed@ (both listed as reviewers on D12785). -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few.