Re: [PATCH] strbuf: let strbuf_addftime handle %z and %Z itself
- From
Jeff King <peff@peff.net>
- Date
- Jun 12, 2017, 17:36 UTC
- Message-ID
- <20170612173601.kpdkxb23r6shssl6@sigill.intra.peff.net>
- In-Reply-To
- <d7e3abd9-0fac-8336-de34-dbd9aad39bd9@web.de>
On Mon, Jun 12, 2017 at 06:58:13PM +0200, René Scharfe wrote:
Show 7 quoted lines
> > We could also simply replace "%Z" with the empty string, as the the
> > POSIX strftime() documentation allows for:
> > http://pubs.opengroup.org/onlinepubs/009695399/functions/strftime.html
> > ("Replaced by the timezone name or abbreviation, or by no bytes if no
> > timezone information exists.").
>
> Yes, that's what the patch does.Yeah, after thinking about all that was said in this thread, the empty string is the only thing that makes sense to me.
IMHO, your patch as-is is a strict improvement. Mine on top (to handle the "-local" cases) is optional, but I think worth doing. It makes the rule easy to understand and explain ("-local" makes %Z behave as expected, and the non-local variants leave it blank because the information isn't present).
-Peff