* strftime.c (my_strftime): Rewrite the previous change slightly,
authorPaul Eggert <eggert@cs.ucla.edu>
Thu, 22 Sep 2005 23:37:18 +0000 (23:37 +0000)
committerPaul Eggert <eggert@cs.ucla.edu>
Thu, 22 Sep 2005 23:37:18 +0000 (23:37 +0000)
commitc0e63657aced0f505bab0d91a2d5db472d7d1013
tree0954851f345135ac79603bdf3d1b449f188c89ff
parent357e1c26576e584fbc24b72798d2f7cf70bd9867
* strftime.c (my_strftime): Rewrite the previous change slightly,
to make it a bit faster and (I hope) clearer.
* strftime.c (my_strftime): Add support for %:z, %::z, %:::z.
Fix bug in formats like %2N.
* strftime.c [FPRINTFTIME] (fprintftime): Provide a new interface:
size_t fprintftime (FILE *fp, char const *fmt, struct tm const *tm,
    int utc, int nanoseconds);
Background:
date should not have to allocate a megabyte of virtual memory to
handle a format argument like +%1048575T.  When implemented with
strftime, it must allocate such a buffer, use strftime to fill it
in, print it, then free it.
With fprintftime, it simply prints everything and exits.
With no need for memory allocation, that's one fewer way to fail.
* strftime.c (my_strftime): Parse the colons of %:::z *after* the
optional field width, not before, so we accept %9:z, not %:9z.
(my_strftime): Be sure to use L_('x') for literals.
lib/strftime.c