]> Savannah Git Hosting - gnulib.git/commitdiff
nstrftime, c-nstrftime: Make %h work on native Windows.
authorBruno Haible <bruno@clisp.org>
Mon, 27 May 2024 21:17:01 +0000 (23:17 +0200)
committerBruno Haible <bruno@clisp.org>
Mon, 27 May 2024 21:17:01 +0000 (23:17 +0200)
* doc/posix-functions/strftime.texi: Mention the %h problem.
* lib/strftime.c (__strftime_internal): On native Windows, for %h, do a
%b directive.

ChangeLog
doc/posix-functions/strftime.texi
lib/strftime.c

index 10e464af786c06c28263ad35051733a651e31319..a9dc4859ca95fc60ba4110df3c245393eca50de4 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2024-05-27  Bruno Haible  <bruno@clisp.org>
+
+       nstrftime, c-nstrftime: Make %h work on native Windows.
+       * doc/posix-functions/strftime.texi: Mention the %h problem.
+       * lib/strftime.c (__strftime_internal): On native Windows, for %h, do a
+       %b directive.
+
 2024-05-27  Bruno Haible  <bruno@clisp.org>
 
        nstrftime, c-nstrftime: Make %c work on native Windows.
index 68af3224a4878b7da2eee77016ff0763c038708f..7cba218a9725f9e9ac63b4a7203079d4ecdd1b9c 100644 (file)
@@ -25,6 +25,9 @@ The %c specifier produces no weekday name and no month name, only a
 potentially ambiguous numerical output, on some platforms:
 mingw, MSVC.
 @item
+The %h specifier produces empty output on some platforms:
+mingw, MSVC.
+@item
 The %r specifier produces empty output, at least in a French locale,
 on some platforms:
 macOS 12.5, FreeBSD 14.0.
index 069bab7095246d8794fbf60f308dd4324334de30..ccfa79daac12a1023fc465e16fd549603549e89b 100644 (file)
@@ -1251,6 +1251,9 @@ __strftime_internal (STREAM_OR_CHAR_T *s, STRFTIME_ARG (size_t maxsize)
           cpy (am_len, a_month);
           break;
 #else
+# if defined _WIN32 && !defined __CYGWIN__
+          format_char = L_('b');
+# endif
           goto underlying_strftime;
 #endif