summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libguile/read.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/libguile/read.c b/libguile/read.c
index a784f3421..b2773cd3c 100644
--- a/libguile/read.c
+++ b/libguile/read.c
@@ -848,12 +848,18 @@ scm_read_character (scm_t_wchar chr, SCM port)
{
/* Dirk:FIXME:: This type of character syntax is not R5RS
* compliant. Further, it should be verified that the constant
- * does only consist of octal digits. Finally, it should be
- * checked whether the resulting fixnum is in the range of
- * characters. */
+ * does only consist of octal digits. */
SCM p = scm_string_to_number (charname, scm_from_uint (8));
if (SCM_I_INUMP (p))
- return SCM_MAKE_CHAR (SCM_I_INUM (p));
+ {
+ scm_t_wchar c = SCM_I_INUM (p);
+ if (SCM_IS_UNICODE_CHAR (c))
+ return SCM_MAKE_CHAR (c);
+ else
+ scm_i_input_error (FUNC_NAME, port,
+ "out-of-range octal character escape: ~a",
+ scm_list_1 (charname));
+ }
}
/* The names of characters should never have non-Latin1