]> Savannah Git Hosting - gnulib.git/commitdiff
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>
Fri, 31 May 2024 22:05:56 +0000 (00:05 +0200)
* doc/posix-functions/strftime.texi: Mention the %h problem.
* lib/nstrftime.c (__strftime_internal): On native Windows, for %h, do a
%b directive.

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

index 8a90f3e2f1d3c6ab2d688bc6de25b31e691cb56d..bc9c4e8901e5b940d39ee975a6342818f0b6a0db 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2024-05-27  Bruno Haible  <bruno@clisp.org>
+
+       nstrftime: Make %h work on native Windows.
+       * doc/posix-functions/strftime.texi: Mention the %h problem.
+       * lib/nstrftime.c (__strftime_internal): On native Windows, for %h, do a
+       %b directive.
+
 2024-05-27  Bruno Haible  <bruno@clisp.org>
 
        nstrftime: Make %c work on native Windows.
index a4b47dc343b389203582be741784af7488643652..b0bd2b536ee832e97dd5593b41fe28e8fa6975e2 100644 (file)
@@ -20,6 +20,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 Windows C runtime library (which is used by MinGW) does not
 support the %e specifier (and possibly the other more recent SUS
 specifiers too, i.e., %C, %D, %h, %n, %r, %R, %t, and %T).
index a7b8a411460578b9f84f82aa00ed4d7e4e879967..ed9118ab1cfe8fb0fb73b5503b0cc3256fee62df 100644 (file)
@@ -807,6 +807,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