From owner-svn-src-head@FreeBSD.ORG Tue Apr 21 19:08:18 2009 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 A87601065679; Tue, 21 Apr 2009 19:08:18 +0000 (UTC) (envelope-from rdivacky@vlk.vlakno.cz) Received: from vlakno.cz (77-93-215-190.static.masterinter.net [77.93.215.190]) by mx1.freebsd.org (Postfix) with ESMTP id 608488FC30; Tue, 21 Apr 2009 19:08:18 +0000 (UTC) (envelope-from rdivacky@vlk.vlakno.cz) Received: from localhost (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id 67FD29CB0F0; Tue, 21 Apr 2009 21:07:03 +0200 (CEST) X-Virus-Scanned: amavisd-new at vlakno.cz Received: from vlakno.cz ([127.0.0.1]) by localhost (lev.vlakno.cz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Mxs+duO08fTc; Tue, 21 Apr 2009 21:06:51 +0200 (CEST) Received: from vlk.vlakno.cz (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id A2C309CB110; Tue, 21 Apr 2009 21:06:51 +0200 (CEST) Received: (from rdivacky@localhost) by vlk.vlakno.cz (8.14.3/8.14.3/Submit) id n3LJ6p15002852; Tue, 21 Apr 2009 21:06:51 +0200 (CEST) (envelope-from rdivacky) Date: Tue, 21 Apr 2009 21:06:51 +0200 From: Roman Divacky To: src-committers@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, svn-src-head@FreeBSD.ORG Message-ID: <20090421190651.GA2505@freebsd.org> References: <200904201819.n3KIJcZo054306@svn.freebsd.org> <20090421185436.GA18628@zim.MIT.EDU> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20090421185436.GA18628@zim.MIT.EDU> User-Agent: Mutt/1.4.2.3i Cc: Subject: Re: svn commit: r191330 - head/usr.bin/ncal 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, 21 Apr 2009 19:08:19 -0000 On Tue, Apr 21, 2009 at 02:54:36PM -0400, David Schultz wrote: > On Mon, Apr 20, 2009, Roman Divacky wrote: > > Author: rdivacky > > Date: Mon Apr 20 18:19:38 2009 > > New Revision: 191330 > > URL: http://svn.freebsd.org/changeset/base/191330 > > > > Log: > > Implement highlighting of today in month view of cal/ncal just like > > gnu cal does. This is currently disabled for year view because of hard > > coded padding in that case. This will hopefully be fixed soon. > > As I recall, ncal relies on the length of each line it formats to > take care of alignment issues in various places. Are you sure that > adding control characters doesn't break that? yes, thats why the year printing is disabled (because the highlighting didnt work there) > Also, before this change, ncal was already full of convoluted > buffer handling, arbitrary buffer sizes, and little to no bounds > checking. This commit adds more magic numbers and fragile buffer > handling code, and generally makes an already hairy program even > less scrutable. This isn't your fault, but it would be nice if we > could make ncal better before it gets much worse. For instance, > you might use snprintf() or asprintf() instead of an extra half > dozen calls to memcpy() with various offsets. yes, thats true. do you want me to revert this? I am perfectly fine with having locally modified cal that supports this highlighting and not share this with world at all.