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.
This commit is contained in:
Augustin Cavalier
2025-12-04 16:41:45 -05:00
parent 984dfdee36
commit 3b66de32f4
@@ -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;