[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
FIX: uptime - localized AM/PM
From: |
Jason Reusch |
Subject: |
FIX: uptime - localized AM/PM |
Date: |
Tue, 2 Apr 2002 21:54:52 -0500 |
I was reading the source code to uptime, found the following FIXME, and
fixed it.
/* FIXME: use strftime, not am, pm. Uli reports that
the german translation is meaningless. */
Here's a diff of the changes against the uptime.c file included in
sh-utils-2.0.11 (alpha). Full uptime.c attached if needed. Compiled
and tested on RedHat 7.2 (kernel 2.4.7-10). Enjoy!
57a58,63
>
> /* variables for localized am/pm */
> char buf_localized_ampm[BUFSIZ];
> size_t max_size = BUFSIZ - 1; /* leave room for a null terminator */
> size_t result = 0;
>
116a123,127
>
> /* get localized am/pm */
> result = strftime (buf_localized_ampm, max_size, _("%p"), tmn);
> buf_localized_ampm[result] = '\0';
>
119,121c130
< /* FIXME: use strftime, not am, pm. Uli reports that
< the german translation is meaningless. */
< tmn->tm_min, (tmn->tm_hour < 12 ? _("am") : _("pm")));
---
> tmn->tm_min, buf_localized_ampm);
uptime.c
Description: Binary data
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- FIX: uptime - localized AM/PM,
Jason Reusch <=