[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: lib/strftime.c bug for %r
From: |
Jim Meyering |
Subject: |
Re: lib/strftime.c bug for %r |
Date: |
Wed, 28 May 2003 19:57:41 +0200 |
Daniel Yacob <address@hidden> wrote:
> I found that the "date" utility was not displaying the format defined
> in locales properly for %r (aka t_fmt_ampm). The 'r' case at line
> 1173 in coreutils-5.0 seems to be the problem. There is no
> "goto underlying_strftime;" statement as seen for the related
> %c, %x, %X cases.
>
> The "if" statement in the 'r' case seems a little suspect too, but
> I don't know what the _NL_CURRENT is about.
>
> Please look into, I tested with the following snippet and it worked
> as I was expecting (defferred to the locale):
>
>
> # if HAVE_STRFTIME
> goto underlying_strftime;
> # else
> subfmt = L_("%I:%M:%S %p");
> # endif
Thanks for the report.
However, I don't see the problem (using date
from coreutils-5.0, linux-2.4.19, libc-2.3.1):
$ date +%F\ %X
2003-05-28 19:55:29
$ LC_ALL=C date +%r
07:55:29 PM
$ LC_ALL=fr_FR.UTF-8 date +%r
07:55:29 <--- notice the trailing blank, and no AM/PM indicator
That's because %r expands to the empty string in that locale.
You should include the version of your operating system,
the version of the C library (run /lib/libc.so), and which
locale you're using (run the `locale' command).
Then give command/output pairs like the above, and tell
us what you expected to get.