From 3b66de32f47f31ad66891eab9c91daf17410f3eb Mon Sep 17 00:00:00 2001 From: Augustin Cavalier Date: Thu, 4 Dec 2025 16:41:45 -0500 Subject: [PATCH] libroot/strftime: Add support for %k and %l. These aren't in POSIX but glibc and FreeBSD support them, and our ICUTimeData class expects that strftime will handle them. Fixes #18471 and some of the problems described in #14356. --- src/system/libroot/posix/musl/time/strftime.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/system/libroot/posix/musl/time/strftime.c b/src/system/libroot/posix/musl/time/strftime.c index 87c2ca5f43..5bf777f56c 100644 --- a/src/system/libroot/posix/musl/time/strftime.c +++ b/src/system/libroot/posix/musl/time/strftime.c @@ -95,9 +95,19 @@ const char *__strftime_fmt_1(char (*s)[100], size_t *l, int f, const struct tm * if (f=='g') val %= 100; else width = 4; goto number; +#ifdef __HAIKU__ + case 'k': + def_pad = '_'; + // fallthrough +#endif case 'H': val = tm->tm_hour; goto number; +#ifdef __HAIKU__ + case 'l': + def_pad = '_'; + // fallthrough +#endif case 'I': val = tm->tm_hour; if (!val) val = 12;