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/eval.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'libguile/eval.c') diff --git a/libguile/eval.c b/libguile/eval.c index d60b8de91..db6d3a5e9 100644 --- a/libguile/eval.c +++ b/libguile/eval.c @@ -1,4 +1,4 @@ -/* Copyright 1995-1996,1997-2014,2018 +/* Copyright 1995-2019 Free Software Foundation, Inc. This file is part of Guile. @@ -201,22 +201,22 @@ env_set (SCM env, int depth, int width, SCM val) static void error_missing_value (SCM proc, SCM kw) { - scm_error_scm (scm_from_latin1_symbol ("keyword-argument-error"), proc, - scm_from_locale_string ("Keyword argument has no value"), SCM_EOL, + scm_error_scm (scm_from_utf8_symbol ("keyword-argument-error"), proc, + scm_from_utf8_string ("Keyword argument has no value"), SCM_EOL, scm_list_1 (kw)); } static void error_invalid_keyword (SCM proc, SCM obj) { - scm_error_scm (scm_from_latin1_symbol ("keyword-argument-error"), proc, - scm_from_locale_string ("Invalid keyword"), SCM_EOL, + scm_error_scm (scm_from_utf8_symbol ("keyword-argument-error"), proc, + scm_from_utf8_string ("Invalid keyword"), SCM_EOL, scm_list_1 (obj)); } static void error_unrecognized_keyword (SCM proc, SCM kw) { - scm_error_scm (scm_from_latin1_symbol ("keyword-argument-error"), proc, - scm_from_locale_string ("Unrecognized keyword"), SCM_EOL, + scm_error_scm (scm_from_utf8_symbol ("keyword-argument-error"), proc, + scm_from_utf8_string ("Unrecognized keyword"), SCM_EOL, scm_list_1 (kw)); } @@ -233,9 +233,9 @@ truncate_values (SCM x) return scm_i_value_ref (x, 0); else { - scm_ithrow (scm_from_latin1_symbol ("vm-run"), - scm_list_3 (scm_from_latin1_symbol ("vm-run"), - scm_from_locale_string + scm_ithrow (scm_from_utf8_symbol ("vm-run"), + scm_list_3 (scm_from_utf8_symbol ("vm-run"), + scm_from_utf8_string ("Too few values returned to continuation"), SCM_EOL), 1); -- cgit v1.2.3