This is the mail archive of the
libc-alpha@sourceware.cygnus.com
mailing list for the glibc project.
Re: Fwd: Bug#41144: incomplete or broken locale defns cause generalchaos
- To: jk@espy.org
- Subject: Re: Fwd: Bug#41144: incomplete or broken locale defns cause generalchaos
- From: Geoff Keating <geoffk@ozemail.com.au>
- Date: Mon, 23 Aug 1999 11:22:21 +1000
- CC: libc-alpha@sourceware.cygnus.com, 41144-forwarded@bugs.debian.org
- References: <v0420550ab3e61aa45178@[206.163.71.146]>
> Mailing-List: contact libc-alpha-help@sourceware.cygnus.com; run by ezmlm
> List-Unsubscribe: <mailto:libc-alpha-unsubscribe-geoffk=discus.anu.edu.au@sourceware.cygnus.com>
> List-Archive: <http://sourceware.cygnus.com/ml/libc-alpha/>
> List-Post: <mailto:libc-alpha@sourceware.cygnus.com>
> List-Help: <mailto:libc-alpha-help@sourceware.cygnus.com>,
> <http://sourceware.cygnus.com/ml/#faqs>
> Date: Sun, 22 Aug 1999 14:28:34 -0700
> From: Joel Klecker <jk@espy.org>
> Cc: 41144-forwarded@bugs.debian.org
>
> [ Forwarded from the Debian Bug-tracking system, please keep
> 41144-forwarded@bugs.debian.org cc'ed so replies are recorded. ]
>
> Is this a bug? Is it feasible to fix?
>
> The data files are created using the install-locales makefile target.
This is a bug in 'date'. You can work around it by writing something
like
date '+%p '
the manual says:
_Warning:_ This convention for the return value which is prescribed
in ISO C can lead to problems in some situations. For certain
format strings and certain locales the output really can be the
empty string and this cannot be discovered by testing the return
value only. E.g., in most locales the AM/PM time format is not
supported (most of the world uses the 24 hour time
representation). In such locales `"%p"' will return the empty
string, i.e., the return value is zero. To detect situations like
this something similar to the following code should be used:
buf[0] = '\1';
len = strftime (buf, bufsize, format, tp);
if (len == 0 && buf[0] != '\0')
{
/* Something went wrong in the strftime call. */
...
}
--
Geoffrey Keating <geoffk@cygnus.com>