unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
* setlocale - incorrect error signalled
@ 2005-01-21 12:15 Bruno Haible
  2005-01-21 21:49 ` Kevin Ryde
  0 siblings, 1 reply; 4+ messages in thread
From: Bruno Haible @ 2005-01-21 12:15 UTC (permalink / raw)


When setlocale is called with a locale name that doesn't exist,
the C function setlocale() returns NULL, and guile signals an error.
This is OK. But guile presents incorrect error details:

  $ guile
  guile> (setlocale LC_ALL "uk_UK.UTF-8")

  Backtrace:
  In standard input:
     1: 0* [setlocale 6 "uk_UK.UTF-8"]

  standard input:1:1: In procedure setlocale in expression (setlocale LC_ALL "uk_UK.UTF-8"):
  standard input:1:1: No such file or directory

"No such file or directory" is incorrect. setlocale() is not required to
set errno when it fails, see
http://www.opengroup.org/onlinepubs/009695399/functions/setlocale.html
Therefore guile should not look at errno when it signals an error.

libguile/posix.c:

  rv = setlocale (scm_i_to_lc_category (category, 1), clocale);
  if (rv == NULL)
    SCM_SYSERROR;     <=== This is the problem.

Bruno



_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-devel


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2005-01-24 15:19 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-01-21 12:15 setlocale - incorrect error signalled Bruno Haible
2005-01-21 21:49 ` Kevin Ryde
2005-01-23 21:57   ` Kevin Ryde
2005-01-24 15:19   ` Bruno Haible

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).