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/expand.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'libguile/expand.c') diff --git a/libguile/expand.c b/libguile/expand.c index eccb889ce..dd6eab0fe 100644 --- a/libguile/expand.c +++ b/libguile/expand.c @@ -1,4 +1,4 @@ -/* Copyright 1995-1996,1997-2014,2018 +/* Copyright 1995-2014,2016,2018-2019 Free Software Foundation, Inc. This file is part of Guile. @@ -224,7 +224,7 @@ SCM_KEYWORD (kw_rest, "rest"); static void syntax_error (const char* const msg, const SCM form, const SCM expr) { - SCM msg_string = scm_from_locale_string (msg); + SCM msg_string = scm_from_utf8_string (msg); SCM filename = SCM_BOOL_F; SCM linenr = SCM_BOOL_F; const char *format; @@ -487,7 +487,7 @@ expand_cond_clauses (SCM clause, SCM rest, int elp, int alp, SCM env) && scm_is_eq (CADR (clause), scm_sym_arrow) && alp) { - SCM tmp = scm_gensym (scm_from_locale_string ("cond ")); + SCM tmp = scm_gensym (scm_from_utf8_string ("cond ")); SCM new_env = scm_acons (tmp, tmp, env); ASSERT_SYNTAX (length > 2, s_missing_recipient, clause); ASSERT_SYNTAX (length == 3, s_extra_expression, clause); @@ -1596,7 +1596,7 @@ make_exp_vtable (size_t n) layout = scm_string_to_symbol (scm_string_append (scm_make_list (scm_from_size_t (exp_nfields[n]), - scm_from_locale_string ("pw")))); + scm_from_utf8_string ("pw")))); printer = SCM_BOOL_F; name = scm_from_utf8_symbol (exp_names[n]); code = scm_from_size_t (n); @@ -1638,7 +1638,7 @@ scm_init_expand () DEFINE_NAMES (LETREC); scm_exp_vtable_vtable = - scm_make_vtable (scm_from_locale_string (SCM_VTABLE_BASE_LAYOUT "pwuwpw"), + scm_make_vtable (scm_from_utf8_string (SCM_VTABLE_BASE_LAYOUT "pwuwpw"), SCM_BOOL_F); for (n = 0; n < SCM_NUM_EXPANDED_TYPES; n++) -- cgit v1.2.3