From 3ae69f30632dba1677d2ed822297cf4599a8d9dd Mon Sep 17 00:00:00 2001 From: Mark H Weaver Date: Tue, 16 Oct 2018 02:34:18 -0400 Subject: Use 'scm_from_utf8_{string,symbol,keyword}' for C string literals. Partial fix for . Reported by Tom de Vries . Fix several instances of the mistake of using 'scm_from_locale_*' for C strings that originally came from a C string literal. Change several uses of 'scm_from_latin1_*' as well, to promote the practice of writing code that works for arbitrary C string literals. Also add missing years to the copyright notices of changed files, based on the git history. * libguile/debug-malloc.c, libguile/deprecation.c, libguile/error.c, libguile/eval.c, libguile/expand.c, libguile/extensions.c, libguile/filesys.c, libguile/init.c, libguile/load.c, libguile/modules.c, libguile/pairs.c, libguile/posix.c, libguile/print.c, libguile/random.c, libguile/read.c, libguile/regex-posix.c, libguile/snarf.h, libguile/srfi-13.c, libguile/stacks.c, libguile/stime.c, libguile/strports.c, libguile/values.c: Use 'scm_from_utf8_*' where appropriate. --- libguile/error.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'libguile/error.c') diff --git a/libguile/error.c b/libguile/error.c index 01a2e8d41..aa45aec27 100644 --- a/libguile/error.c +++ b/libguile/error.c @@ -1,4 +1,4 @@ -/* Copyright 1995-1998,2000-2001,2004,2006,2010,2012-2014,2018 +/* Copyright 1995-1998,2000-2001,2004,2006,2010,2012-2016,2018-2019 Free Software Foundation, Inc. This file is part of Guile. @@ -61,8 +61,8 @@ scm_error (SCM key, const char *subr, const char *message, SCM args, SCM rest) { scm_error_scm (key, - (subr == NULL) ? SCM_BOOL_F : scm_from_locale_string (subr), - (message == NULL) ? SCM_BOOL_F : scm_from_locale_string (message), + (subr == NULL) ? SCM_BOOL_F : scm_from_utf8_string (subr), + (message == NULL) ? SCM_BOOL_F : scm_from_utf8_string (message), args, rest); } @@ -235,7 +235,7 @@ scm_error_num_args_subr (const char *subr) scm_error (scm_args_number_key, NULL, "Wrong number of arguments to ~A", - scm_list_1 (scm_from_locale_string (subr)), + scm_list_1 (scm_from_utf8_string (subr)), SCM_BOOL_F); } @@ -258,8 +258,8 @@ scm_i_wrong_type_arg_symbol (SCM symbol, int pos, SCM bad_value) { scm_error_scm (scm_arg_type_key, scm_symbol_to_string (symbol), - (pos == 0) ? scm_from_locale_string ("Wrong type: ~S") - : scm_from_locale_string ("Wrong type argument in position ~A: ~S"), + (pos == 0) ? scm_from_utf8_string ("Wrong type: ~S") + : scm_from_utf8_string ("Wrong type argument in position ~A: ~S"), (pos == 0) ? scm_list_1 (bad_value) : scm_list_2 (scm_from_int (pos), bad_value), scm_list_1 (bad_value)); @@ -269,7 +269,7 @@ scm_i_wrong_type_arg_symbol (SCM symbol, int pos, SCM bad_value) void scm_wrong_type_arg_msg (const char *subr, int pos, SCM bad_value, const char *szMessage) { - SCM msg = scm_from_locale_string (szMessage); + SCM msg = scm_from_utf8_string (szMessage); if (pos == 0) { scm_error (scm_arg_type_key, -- cgit v1.2.3