+2024-03-24 Bruno Haible <bruno@clisp.org>
+
+ nstrtime, c-nstrftime: Fix %c directive's result on glibc ≤ 2.30.
+ * lib/strftime.c (__strftime_internal): On glibc ≤ 2.30, like on NetBSD
+ and Solaris, remove the last word of the %c directive's result if it
+ looks like a time zone.
+ * doc/posix-functions/strftime.texi: Update platforms list.
+
2024-03-24 Bruno Haible <bruno@clisp.org>
gnulib-tool.py: Fix output of notices.
The %c specifier does not work with a time retrieved through @code{gmtime}
or @code{gmtime_r}, since it outputs also the current time zone,
on some platforms:
-NetBSD 9.3, Solaris 11.4.
+glibc 2.30, NetBSD 9.3, Solaris 11.4.
@item
The %r specifier produces empty output, at least in a French locale,
on some platforms:
# endif
if (len != 0)
{
-# if defined __NetBSD__ || defined __sun /* NetBSD, Solaris */
+# if (__GLIBC__ == 2 && __GLIBC_MINOR__ < 31) || defined __NetBSD__ || defined __sun /* glibc < 2.31, NetBSD, Solaris */
if (format_char == L_('c'))
{
/* The output of the strftime %c directive consists of the
}
}
}
-# if REQUIRE_GNUISH_STRFTIME_AM_PM
+# if (defined __NetBSD__ || defined __sun) && REQUIRE_GNUISH_STRFTIME_AM_PM
/* The output of the strftime %p and %r directives contains
an AM/PM indicator even for locales where it is not
suitable, such as French. Remove this indicator. */