Greg Troxel <g...@ir.bbn.com> writes:

> scheme@(guile-user)> (setlocale LC_ALL "does-not-exist")  
> "C"

This looks wrong to me:

  Upon successful completion, setlocale() shall return the string
  associated with the specified category for the new locale.  Otherwise,
  setlocale() shall return a null pointer and the locale of the process
  is not changed.

  http://www.opengroup.org/onlinepubs/9699919799/functions/setlocale.html

Here we do not expect "successful completion", so it "shall return a
null pointer".

Can you submit a bug report against NetBSD's C library?

> list gdt 8 ~ > cat l.c
> #include <langinfo.h>
> #include <nl_types.h>
> #include <locale.h>
>
> #include <stdio.h>
> #include <assert.h>
>
>
> int
> main (int argc, char *argv[])
> {
>   char *s;
>
>   s = setlocale (LC_ALL, "C");
>   assert (s != NULL);
>
>   printf ("DAY_1: %s\n", nl_langinfo (DAY_1));
>
>   s = setlocale (LC_ALL, "en_GB");
>   assert (s != NULL);
>
>   printf ("DAY_1: %s\n", nl_langinfo (DAY_1));
>
>   return 0;
> }
> list gdt 9 ~ > cc -o l l.c
> list gdt 10 ~ > ./l
> DAY_1: Sun
> DAY_1: Sun

Both look wrong to me: it returns the abbreviated name of the day
instead of the full name of the day
(http://www.opengroup.org/onlinepubs/9699919799/basedefs/langinfo.h.html).

Can you report a bug for this one, too?

Thanks,
Ludo'.



Reply via email to