Age | Commit message (Collapse) | Author |
|
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.
|
|
to make it a bit faster and (I hope) clearer.
|
|
|
|
optional field width, not before, so we accept %9:z, not %:9z.
|
|
|
|
Fix bug in formats like %2N.
|
|
number and when used with a zero-padded field width, e.g. %015s.
(my_strftime): Move the `do_number_sign_and_padding'
label so that it precedes the code to set `digits'. Otherwise,
%0Ns wouldn't work. Before this change, `date -d @-22 +%05s' would
print `00-22'. Now, it prints `-0022', as it should.
|
|
Copy the input structure, to work around some of the bug with
Solaris 2.5.1 and Solaris 2.6.
|
|
|
|
|
|
(which shouldn't happen), generate nothing instead of returning 0
immediately, so that nstrftime (NULL, ...) doesn't return 0.
|
|
reliably distinguish strftime failure from empty output on POSIX
hosts.
|
|
&& HAVE_STRUCT_ERA_ENTRY)]: Initialize the first byte of ubuf[].
|
|
(INT_STRLEN_BOUND): Switch to same implementation as intprops.h.
|
|
(my_strftime): Do not mishandle years close to INT_MAX, by doing
the right thing even if adding 1900 would overflow. Similarly
for tm_mon + 1 and tm_yday + 1.
Make %Y always equivalent to %C%y, and similarly for %G and %g.
(DO_NUMBER, DO_NUMBER_SPACEPAD): Set digits to d, not a conditional.
(DO_SIGNED_NUMBER): New macro.
(my_strftime) [HAVE_TZNAME]: Don't dump core if tp->tm_dst > 1.
|
|
|
|
|
|
|
|
(my_strftime_localtime_r): Remove; all uses changed to __localtime_r.
(__gtime_r, __localtime_r) [!HAVE_TM_GMTOFF]: New macros.
Include <time_r.h>.
|
|
|
|
|
|
(my_strftime) [!_LIBC && HAVE_TZNAME && HAVE_TZSET]:
Remove function, now that we can rely on a working tzset function.
Ensure that the required autoconf test has been run.
|
|
(my_strftime) [!defined _NL_CURRENT && HAVE_STRFTIME]:
Use underlying_strftime for %r.
|
|
the space-padded-by-default conversion specifiers, %e, %k, %l.
|
|
each sequence of spaces before a TAB character.
|
|
|
|
(my_strftime): Handle very large width
specifications for numeric values correctly. Improve checks for
overflow.
|
|
(nl_get_alt_digit) [! defined my_strftime]: Define.
(my_strftime) [_NL_CURRENT]: Merge nearly-identical uses of
_nl_get_alt_digit and _nl_get_walt_digit.
|
|
These changes have no effect outside of _LIBC.
|
|
definition in the `#if ! HAVE_TM_GMTOFF' block.
|
|
Define to nstrftime if emacs, but only if my_strftime is not defined.
(extra_args, extra_args_spec, extra_args_spec_iso): Rename from
ut_argument, ut_argument_spec, ut_argument_spec_iso, respectively.
Add one more extra argument: a nanoseconds value.
All uses changed.
(ns): New macro.
(my_strftime function): Add %N format.
(emacs_strftimeu): Renamed from emacs_strftime,
with extra ut argument.
|
|
|
|
|
|
size of (size_t) -1; it's not portable.
|
|
|
|
|
|
of it to rpl_strftime also defined-away the system's declaration.
|
|
strftime, not ourselves, when invoking the underlying strftime.
|
|
|
|
'\a', so don't bother optimizing for it.
|
|
|
|
|
|
|
|
library's localtime_r and gmtime_r; there are too many buggy
implementations of localtime_r and gmtime_r out there, and
it's not worth keeping track of all the different bugs.
* strftime.c (__EXTENSIONS__): Remove.
(my_strftime_gmtime_r): Renamed from gmtime_r; all uses changed.
(my_strftime_localtime_r): Renamed from localtime_r; all uses changed.
Base them on localtime/gmtime if not _LIBC.
|
|
|
|
localtime_r to be declared properly.
|
|
|
|
|
|
From Paul Eggert.
|
|
|