From owner-svn-src-head@freebsd.org Fri Nov 3 13:15:16 2017 Return-Path: Delivered-To: svn-src-head@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 4B026E521A7; Fri, 3 Nov 2017 13:15:16 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from smtp-out-so.shaw.ca (smtp-out-so.shaw.ca [64.59.136.138]) (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 003C46401A; Fri, 3 Nov 2017 13:15:15 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from spqr.komquats.com ([96.50.22.10]) by shaw.ca with SMTP id AboQeYgI98LPZAboReiNCd; Fri, 03 Nov 2017 07:15:08 -0600 X-Authority-Analysis: v=2.2 cv=e552ceh/ c=1 sm=1 tr=0 a=jvE2nwUzI0ECrNeyr98KWA==:117 a=jvE2nwUzI0ECrNeyr98KWA==:17 a=kj9zAlcOel0A:10 a=xqWC_Br6kY4A:10 a=sC3jslCIGhcA:10 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=Qf9cLlZmb_5xpU_xI4UA:9 a=CjuIK1q_8ugA:10 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 5D58736C; Fri, 3 Nov 2017 06:15:06 -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 vA3DF6Oc041175; Fri, 3 Nov 2017 06:15:06 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201711031315.vA3DF6Oc041175@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: 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 13:08:29 -0000." <201711031308.vA3D8Tj1051559@repo.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Fri, 03 Nov 2017 06:15:06 -0700 X-CMAE-Envelope: MS4wfD8Zh2wJaYrosL8ZccvuTnDJLq+Mn2dw1d99FjkehY3aUMvGpGGGHMpLEIhnsvYlFhGW7WnKunlN8pXn9csVwwOMGbFBVgmpDDhU2K4Xk204NpggwcSJ FMaCgJbeuWhTKXa9u+Es2Omhf44NFjUwp4DCWAyA7xScyHv+8mP1tYb3sySUwtPE07giy5ZZ2LzKunQYSMM+3BHExE6GplQsnnHsJFUvrwJzlRHu76qWM96v R+2r2/Zq/oistE+ht3xOL/NteAZd7ZkflILumHssqYINSxb5ZTNvYhxfEta9kxGN X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Nov 2017 13:15:16 -0000 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 -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few.