From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp1.rz.uni-karlsruhe.de (Debian-exim@smtp1.rz.uni-karlsruhe.de [129.13.185.217]) by krisdoz.my.domain (8.14.3/8.14.3) with ESMTP id o5CHIkUe027812 for ; Sat, 12 Jun 2010 13:18:48 -0400 (EDT) Received: from hekate.usta.de (asta-nat.asta.uni-karlsruhe.de [172.22.63.82]) by smtp1.rz.uni-karlsruhe.de with esmtp (Exim 4.63 #1) id 1ONUM0-0001t5-Bw; Sat, 12 Jun 2010 19:18:44 +0200 Received: from donnerwolke.usta.de ([172.24.96.3]) by hekate.usta.de with esmtp (Exim 4.71) (envelope-from ) id 1ONUM0-0003tR-Ay for tech@mdocml.bsd.lv; Sat, 12 Jun 2010 19:18:44 +0200 Received: from iris.usta.de ([172.24.96.5] helo=usta.de) by donnerwolke.usta.de with esmtp (Exim 4.69) (envelope-from ) id 1ONUM0-0000q8-A6 for tech@mdocml.bsd.lv; Sat, 12 Jun 2010 19:18:44 +0200 Received: from schwarze by usta.de with local (Exim 4.71) (envelope-from ) id 1ONUM0-0006eB-93 for tech@mdocml.bsd.lv; Sat, 12 Jun 2010 19:18:44 +0200 Date: Sat, 12 Jun 2010 19:18:44 +0200 From: Ingo Schwarze To: tech@mdocml.bsd.lv Subject: Re: Reducing uname footer string on FreeBSD Message-ID: <20100612171844.GE6086@iris.usta.de> References: <20100609163447.GA39829@acme.spoerlein.net> X-Mailinglist: mdocml-tech Reply-To: tech@mdocml.bsd.lv MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20100609163447.GA39829@acme.spoerlein.net> User-Agent: Mutt/1.5.20 (2009-06-14) Hi Ulrich, Ulrich Spörlein wrote on Wed, Jun 09, 2010 at 06:34:47PM +0200: > The attached patch clamps the string after the dash, iff uname reports > we are running on FreeBSD. I don't think such special casing should be > applied in the general source tree, but wanted to put it up for > discussion anyway. Actually, i wouldn't even object to this particular patch going in in case that's easier for you. After all, - post_os() is typically called once per input file; - this is the central place where OS names are handled, so having differences here is not that surprising; - your patch is not expensive: linear in the length of the string "FreeBSD" on FreeBSD, one return-at-once function call everywhere else. So, even if all the four major free BSD implementations would need something like this in post_os(), it would still seem reasonable to me. Yours, Ingo > commit 7b6298d198c875c7d5036f0a8ad81c4a0ea194f9 > Author: Ulrich Spörlein > Date: Mon May 24 16:50:14 2010 +0200 > > mandoc: cut trailing OS string after first dash > > This is to mimick groff behaviour, where only "FreeBSD 8.0" is > displayed in the footer. > > diff --git a/contrib/mdocml/mdoc_action.c b/contrib/mdocml/mdoc_action.c > index f27ef13..ddd7cab 100644 > --- a/contrib/mdocml/mdoc_action.c > +++ b/contrib/mdocml/mdoc_action.c > @@ -611,6 +611,8 @@ post_os(POST_ARGS) > mdoc_nmsg(m, n, MANDOCERR_MEM); > return(0); > } > + if (strncmp(utsname.sysname, "FreeBSD", sizeof("FreeBSD")) == 0) > + strtok(utsname.release, "-"); > if (strlcat(buf, utsname.release, BUFSIZ) >= BUFSIZ) { > mdoc_nmsg(m, n, MANDOCERR_MEM); > return(0); -- To unsubscribe send an email to tech+unsubscribe@mdocml.bsd.lv