diff options
author | Marius Vollmer <mvo@zagadka.de> | 2004-08-10 13:54:01 +0000 |
---|---|---|
committer | Marius Vollmer <mvo@zagadka.de> | 2004-08-10 13:54:01 +0000 |
commit | 29a837fd27e8062caa6eba124d8c84b51b202fc6 (patch) | |
tree | 8456e592692fb0279222331276b1c16de3a32701 | |
parent | 79c98b33fea416592cdac95e94a69e08cf3b3f8f (diff) | |
download | guile-29a837fd27e8062caa6eba124d8c84b51b202fc6.tar.gz |
(scm_input_error): Use a SCM value for 'fn', not a C string. This
avoids a conversion round-trip.
-rw-r--r-- | libguile/read.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/libguile/read.c b/libguile/read.c index 4e27f6591..d3f448aac 100644 --- a/libguile/read.c +++ b/libguile/read.c @@ -76,22 +76,21 @@ scm_t_option scm_read_opts[] = { static void -scm_input_error(char const * function, - SCM port, const char * message, SCM arg) +scm_input_error (char const *function, + SCM port, const char *message, SCM arg) { - char *fn = SCM_STRINGP (SCM_FILENAME(port)) - ? SCM_STRING_CHARS(SCM_FILENAME(port)) - : "#<unknown port>"; + SCM fn = (scm_is_string (SCM_FILENAME(port)) + ? SCM_FILENAME(port) + : scm_from_locale_string ("#<unknown port>")); - SCM string_port = scm_open_output_string (); + SCM string_port = scm_open_output_string (); SCM string = SCM_EOL; scm_simple_format (string_port, scm_makfrom0str ("~A:~S:~S: ~A"), - scm_list_4 (scm_makfrom0str (fn), + scm_list_4 (fn, scm_from_int (SCM_LINUM (port) + 1), scm_from_int (SCM_COL (port) + 1), scm_makfrom0str (message))); - string = scm_get_output_string (string_port); scm_close_output_port (string_port); |