summaryrefslogtreecommitdiff
path: root/libguile/print.c
diff options
context:
space:
mode:
authorMark H Weaver <mhw@netris.org>2018-10-16 02:34:18 -0400
committerAndy Wingo <wingo@pobox.com>2019-05-23 16:41:53 +0200
commit3ae69f30632dba1677d2ed822297cf4599a8d9dd (patch)
tree4f5d8efb70eb1afeccda49f60e5dcf919d48232a /libguile/print.c
parenta47a5e6828432fb80c82ce002553f59c6447b911 (diff)
downloadguile-3ae69f30632dba1677d2ed822297cf4599a8d9dd.tar.gz
Use 'scm_from_utf8_{string,symbol,keyword}' for C string literals.
Partial fix for <https://bugs.gnu.org/33044>. Reported by Tom de Vries <tdevries@suse.de>. 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.
Diffstat (limited to 'libguile/print.c')
-rw-r--r--libguile/print.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/libguile/print.c b/libguile/print.c
index 6eed1bec1..ecda3fb6e 100644
--- a/libguile/print.c
+++ b/libguile/print.c
@@ -1,4 +1,4 @@
-/* Copyright 1995-2004,2006,2008,2009-2015,2017-2018
+/* Copyright 1995-2004,2006,2008-2019
Free Software Foundation, Inc.
This file is part of Guile.
@@ -1313,9 +1313,9 @@ scm_init_print ()
{
SCM type;
- type = scm_make_vtable (scm_from_locale_string (SCM_PRINT_STATE_LAYOUT),
+ type = scm_make_vtable (scm_from_utf8_string (SCM_PRINT_STATE_LAYOUT),
SCM_BOOL_F);
- scm_set_struct_vtable_name_x (type, scm_from_latin1_symbol ("print-state"));
+ scm_set_struct_vtable_name_x (type, scm_from_utf8_symbol ("print-state"));
scm_print_state_vtable = type;
/* Don't want to bind a wrapper class in GOOPS, so pass 0 as arg1. */
@@ -1326,8 +1326,8 @@ scm_init_print ()
scm_init_opts (scm_print_options, scm_print_opts);
scm_print_opts[SCM_PRINT_HIGHLIGHT_PREFIX_I].val =
- SCM_UNPACK (scm_from_locale_string ("{"));
+ SCM_UNPACK (scm_from_utf8_string ("{"));
scm_print_opts[SCM_PRINT_HIGHLIGHT_SUFFIX_I].val =
- SCM_UNPACK (scm_from_locale_string ("}"));
+ SCM_UNPACK (scm_from_utf8_string ("}"));
scm_print_opts[SCM_PRINT_KEYWORD_STYLE_I].val = SCM_UNPACK (sym_reader);
}