guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

setlocale - incorrect error signalled


From: Bruno Haible
Subject: setlocale - incorrect error signalled
Date: Fri, 21 Jan 2005 13:15:01 +0100
User-agent: KMail/1.5

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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]