unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Bruno Haible <bruno@clisp.org>
Subject: setlocale - incorrect error signalled
Date: Fri, 21 Jan 2005 13:15:01 +0100	[thread overview]
Message-ID: <200501211315.01753.bruno@clisp.org> (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


             reply	other threads:[~2005-01-21 12:15 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-01-21 12:15 Bruno Haible [this message]
2005-01-21 21:49 ` setlocale - incorrect error signalled Kevin Ryde
2005-01-23 21:57   ` Kevin Ryde
2005-01-24 15:19   ` Bruno Haible

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200501211315.01753.bruno@clisp.org \
    --to=bruno@clisp.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).