From 9fc7ea0f1495b45eb5dfc773294d3465057f6e63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?= Date: Sat, 5 Oct 2024 23:01:38 +0700 Subject: applets/clock: Fix compatibility with musl libc %l is an glibc extension for strftime, this extensions isn't supported by musl libc. Replace %l with %_I, which is functionaly equivalence. %_I itself is also an extensions, however, %_I is supported by both glibc, musl, FreeBSD and deriviates, AIX, and Solaris. Fix: #1451 --- applets/clock/clock-location-tile.c | 6 +++--- applets/clock/clock.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'applets/clock') diff --git a/applets/clock/clock-location-tile.c b/applets/clock/clock-location-tile.c index e9260a31..385d0da1 100644 --- a/applets/clock/clock-location-tile.c +++ b/applets/clock/clock-location-tile.c @@ -434,7 +434,7 @@ format_time (struct tm *now, * weekday differs from the weekday at the location * (the %A expands to the weekday). The %p expands to * am/pm. */ - format = _("%l:%M %p (%A)"); + format = _("%_I:%M %p (%A)"); } else { /* Translators: This is a strftime format string. @@ -451,7 +451,7 @@ format_time (struct tm *now, * It is used to display the time in 12-hours format * (eg, like in the US: 8:10 am). The %p expands to * am/pm. */ - format = _("%l:%M %p"); + format = _("%_I:%M %p"); } else { /* Translators: This is a strftime format string. @@ -497,7 +497,7 @@ convert_time_to_str (time_t now, ClockFormat clock_format) * It is used to display the time in 12-hours format (eg, like * in the US: 8:10 am). The %p expands to am/pm. */ - format = _("%l:%M %p"); + format = _("%_I:%M %p"); } else { /* Translators: This is a strftime format string. diff --git a/applets/clock/clock.c b/applets/clock/clock.c index f97e56af..e823d37c 100644 --- a/applets/clock/clock.c +++ b/applets/clock/clock.c @@ -458,7 +458,7 @@ get_updated_timeformat (ClockData *cd) /* Translators: This is a strftime format string. * It is used to display the time in 12-hours format (eg, like * in the US: 8:10 am). The %p expands to am/pm. */ - time_format = cd->showseconds ? _("%l:%M:%S %p") : _("%l:%M %p"); + time_format = cd->showseconds ? _("%_I:%M:%S %p") : _("%_I:%M %p"); else /* Translators: This is a strftime format string. * It is used to display the time in 24-hours format (eg, like -- cgit v1.2.1