From owner-svn-src-all@FreeBSD.ORG Wed Apr 22 12:44:35 2009 Return-Path: Delivered-To: svn-src-all@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ED06F1065676; Wed, 22 Apr 2009 12:44:35 +0000 (UTC) (envelope-from das@FreeBSD.ORG) Received: from zim.MIT.EDU (ZIM.MIT.EDU [18.95.3.101]) by mx1.freebsd.org (Postfix) with ESMTP id A26C58FC40; Wed, 22 Apr 2009 12:44:35 +0000 (UTC) (envelope-from das@FreeBSD.ORG) Received: from zim.MIT.EDU (localhost [127.0.0.1]) by zim.MIT.EDU (8.14.3/8.14.2) with ESMTP id n3MClwY5024013; Wed, 22 Apr 2009 08:47:58 -0400 (EDT) (envelope-from das@FreeBSD.ORG) Received: (from das@localhost) by zim.MIT.EDU (8.14.3/8.14.2/Submit) id n3MClwbJ024012; Wed, 22 Apr 2009 08:47:58 -0400 (EDT) (envelope-from das@FreeBSD.ORG) Date: Wed, 22 Apr 2009 08:47:58 -0400 From: David Schultz To: Roman Divacky Message-ID: <20090422124757.GA23877@zim.MIT.EDU> Mail-Followup-To: Roman Divacky , Robert Watson , src-committers@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, svn-src-head@FreeBSD.ORG References: <200904201819.n3KIJcZo054306@svn.freebsd.org> <20090421185436.GA18628@zim.MIT.EDU> <20090421190651.GA2505@freebsd.org> <20090421194622.GA19215@zim.MIT.EDU> <20090421202754.GA19417@zim.MIT.EDU> <20090421203106.GA13661@freebsd.org> <20090422060643.GA22109@zim.MIT.EDU> <20090422071918.GA88935@freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20090422071918.GA88935@freebsd.org> Cc: svn-src-head@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, src-committers@FreeBSD.ORG, Robert Watson Subject: Re: svn commit: r191330 - head/usr.bin/ncal X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 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: Wed, 22 Apr 2009 12:44:37 -0000 On Wed, Apr 22, 2009, Roman Divacky wrote: > > I like your idea about using strcat() things but it wont > help here because the problem is with the overal design. > in detail - the short patch highlights " XY" instead of > just "XY" where some sort of hackery is needed... the pointer > magic there is for exactly this purpose.. > > I'll see if I can improve anything but I doubt that.... Aah, that explains the mysterious `+ 1' (which doesn't work for single-digit dates, does it?) It's probably easier just to get rid of the daystr / jdaystr hack and do something like `sprintf(..., "%s%d%s", term_r, dt.d, term_e)'. The amount of left padding needed before the term_r should be `(jd_flag ? 4 : 3) - snprintf(NULL, 0, "%d", dt.d)'. It's not a high priority in any case.