From: Alex Riesen Date: Fri, 28 Aug 2009 19:20:50 GMT Subject: Re: [PATCH] Round-down years in "years+months" relative date view Message-ID: <81b0412b0908281220o1c378d5dn6ed52c8d55a9cdec@mail.gmail.com> In-Reply-To: <20090828191521.GA12292@coredump.intra.peff.net> On Fri, Aug 28, 2009 at 21:15, Jeff King wrote: > On Fri, Aug 28, 2009 at 09:03:19PM +0200, Alex Riesen wrote: > >> +unsigned long approxidate(const char *date) >> +{ >> +     struct timeval tv; >> +     gettimeofday(&tv, NULL); >> +     return approxidate_relative(date, &tv); >> +} > > This now always calls gettimeofday, whereas the original approxidate > only did if parse_date failed. Oh, bugger... > On the other hand, refactoring the relative date code into its own > function is probably a good thing in the long run. Exactly.