From owner-svn-src-all@FreeBSD.ORG Mon Jul 11 15:14:49 2011 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 B7694106566B; Mon, 11 Jul 2011 15:14:49 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 8F7068FC0A; Mon, 11 Jul 2011 15:14:49 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 44F2546B1A; Mon, 11 Jul 2011 11:14:49 -0400 (EDT) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id BAADE8A02E; Mon, 11 Jul 2011 11:14:48 -0400 (EDT) From: John Baldwin To: Edwin Groothuis Date: Mon, 11 Jul 2011 11:04:10 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110617; KDE/4.5.5; amd64; ; ) References: <201107110824.p6B8OaFj082562@svn.freebsd.org> In-Reply-To: <201107110824.p6B8OaFj082562@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201107111104.10409.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (bigwig.baldwin.cx); Mon, 11 Jul 2011 11:14:48 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r223928 - head/usr.bin/calendar 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: Mon, 11 Jul 2011 15:14:49 -0000 On Monday, July 11, 2011 4:24:36 am Edwin Groothuis wrote: > Author: edwin > Date: Mon Jul 11 08:24:36 2011 > New Revision: 223928 > URL: http://svn.freebsd.org/changeset/base/223928 > > Log: > Fix the interpreter for: > > Jul/Sat+3 Every third saturday of July - Jul/Sat+3 > > which was able to be done via: > > Jul/SatThird Every third saturday of July - Jul/SatThird > > Add interpreters for: > > SatFourth Every third saturday of each month - SatFourth > Sat+4 Every third saturday of each month - Sat+4 > Sat Every saturday of each month - Sat > > MFC after: 2 weeks > > Modified: > head/usr.bin/calendar/parsedata.c > > Modified: head/usr.bin/calendar/parsedata.c > ============================================================================== > --- head/usr.bin/calendar/parsedata.c Mon Jul 11 08:23:59 2011 (r223927) > +++ head/usr.bin/calendar/parsedata.c Mon Jul 11 08:24:36 2011 (r223928) > @@ -548,6 +548,24 @@ parsedaymonth(char *date, int *yearp, in > @@ -918,6 +936,16 @@ indextooffset(char *s) > int i; > struct fixs *n; > > + if (s[0] == '+' || s[0] == '-') { > + char ss[9]; > + for (i = -100; i < 100; i++) { > + sprintf(ss, "%s%d", (i > 0) ? "+" : "", i); > + if (strcmp(ss, s) == 0) > + return (i); > + } > + return (0); > + } > + Hmm, did you consider using something like strtol instead? -- John Baldwin