mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-04-30 11:50:28 +02:00
(scm_input_error): Use a SCM value for 'fn', not a C string. This
avoids a conversion round-trip.
This commit is contained in:
parent
79c98b33fe
commit
29a837fd27
1 changed files with 7 additions and 8 deletions
|
@ -79,20 +79,19 @@ static void
|
|||
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 = 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);
|
||||
scm_error_scm (scm_str2symbol ("read-error"),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue