From owner-svn-src-head@FreeBSD.ORG Tue Sep 14 15:02:35 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4A126106564A; Tue, 14 Sep 2010 15:02:35 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail01.syd.optusnet.com.au (mail01.syd.optusnet.com.au [211.29.132.182]) by mx1.freebsd.org (Postfix) with ESMTP id D85768FC12; Tue, 14 Sep 2010 15:02:34 +0000 (UTC) Received: from c122-107-116-249.carlnfd1.nsw.optusnet.com.au (c122-107-116-249.carlnfd1.nsw.optusnet.com.au [122.107.116.249]) by mail01.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id o8EF2VYC004248 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 15 Sep 2010 01:02:32 +1000 Date: Wed, 15 Sep 2010 01:02:31 +1000 (EST) From: Bruce Evans X-X-Sender: bde@delplex.bde.org To: Pawel Jakub Dawidek In-Reply-To: <201009141119.o8EBJLKU080003@svn.freebsd.org> Message-ID: <20100915003923.B907@delplex.bde.org> References: <201009141119.o8EBJLKU080003@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r212607 - head/sbin/geom/core X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 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: Tue, 14 Sep 2010 15:02:35 -0000 On Tue, 14 Sep 2010, Pawel Jakub Dawidek wrote: > Log: > Remove dot which shouldn't be here, as err(3) will attach error message > at the end of the string. In KNF, error messages are neither capitalized or terminated by a dot, partly because of this. > Modified: head/sbin/geom/core/geom.c > ============================================================================== > --- head/sbin/geom/core/geom.c Tue Sep 14 11:13:46 2010 (r212606) > +++ head/sbin/geom/core/geom.c Tue Sep 14 11:19:21 2010 (r212607) > @@ -262,7 +262,7 @@ set_option(struct gctl_req *req, struct > if (G_OPT_TYPE(opt) == G_TYPE_NUMBER || > G_OPT_TYPE(opt) == G_TYPE_ASCNUM) { > if (expand_number(val, &number) == -1) { > - err(EXIT_FAILURE, "Invalid value for '%c' argument.", > + err(EXIT_FAILURE, "Invalid value for '%c' argument", > opt->go_char); > } > if (G_OPT_TYPE(opt) == G_TYPE_NUMBER) { > This message is still capitalized. Most other error messages in sbin/geom have same bugs. Dots too, though this fixes the last dot for err(). For errx() and warnx(), you can supply the dot without ensuring the punctuation/grammar error ".:", but this is still a style bug since it is not KNF and it is silly for the shorter error messages without an errno string to be capitalized while longer ones with an errno cannot be since err() has a fixed format not including the dot. For the capitalization, a capital letter after the prefix ": " is just a style bug. I think capitalization after ": " looks strange, especially after starting with a lower case program name. Then the errno string messes up the formatting a bit by always being capitalized. In bin/*/*.c 1 month ago, the KNF rule about not capitializing err(1, "Foo") is followed in approx. 66 lines and broken in just 7 lines (1 in cp and 6 in pkill), partly because of tree sweeps to unbreak this. In Lite2 it was followed in approx. 29 lines and broken in just 1 line (in rmail). Bruce