Transcode non-constant strings before passing them to scm_eval_string.

Instead of using scm_c_eval_string, which transcodes with
scm_from_locale_string. That doesn't work on Windows.
This commit is contained in:
John Ralls 2019-04-29 14:58:56 -07:00
parent 1c1fa36023
commit 114efe5936
3 changed files with 4 additions and 5 deletions

View File

@ -932,8 +932,7 @@ gnc_plugin_page_report_recreate_page (GtkWidget *window,
LEAVE("bad value"); LEAVE("bad value");
return NULL; return NULL;
} }
scm_id = scm_eval_string(scm_from_utf8_string(option_string));
scm_id = scm_c_eval_string(option_string);
g_free(option_string); g_free(option_string);
if (!scm_integer_p(scm_id)) if (!scm_integer_p(scm_id))

View File

@ -809,7 +809,7 @@ static void gnc_gsettings_migrate_from_gconf (void)
command = g_strconcat ("(use-modules (migrate-prefs))(migration-prepare \"", command = g_strconcat ("(use-modules (migrate-prefs))(migration-prepare \"",
base_dir, "\")", NULL); base_dir, "\")", NULL);
DEBUG ("command = %s", command); DEBUG ("command = %s", command);
migration_ok = scm_is_true (scm_c_eval_string (command)); migration_ok = scm_is_true (scm_eval_string (scm_from_utf8_string (command)));
g_free (command); g_free (command);
if (!migration_ok) if (!migration_ok)
{ {
@ -867,7 +867,7 @@ static void gnc_gsettings_migrate_from_gconf (void)
command = g_strconcat ("(use-modules (migrate-prefs))(migration-cleanup \"", command = g_strconcat ("(use-modules (migrate-prefs))(migration-cleanup \"",
base_dir, "\")", NULL); base_dir, "\")", NULL);
DEBUG ("command = %s", command); DEBUG ("command = %s", command);
migration_ok = scm_is_true (scm_c_eval_string (command)); migration_ok = scm_is_true (scm_eval_string (scm_from_utf8_string (command)));
g_free (command); g_free (command);
if (!migration_ok) /* Cleanup step failed, not critical */ if (!migration_ok) /* Cleanup step failed, not critical */
PWARN ("Cleanup step failed. You may need to delete %s/.gnc-migration-tmp manually.", base_dir); PWARN ("Cleanup step failed. You may need to delete %s/.gnc-migration-tmp manually.", base_dir);

View File

@ -55,7 +55,7 @@ test_query (Query *q, SCM val2str)
str2 = gnc_scm_to_utf8_string (str_q); str2 = gnc_scm_to_utf8_string (str_q);
if (str2) if (str2)
{ {
res_q = scm_c_eval_string (str2); res_q = scm_eval_string (str_q);
} }
else else
{ {