guile: fix bad conversion of shared strings (replace calls to scm_i_string_chars by scm_to_locale_string) (bug #38067)

This commit is contained in:
Sebastien Helleu 2013-01-12 19:27:00 +01:00
parent 1b56e084dc
commit 4123263b8c
3 changed files with 510 additions and 435 deletions

View File

@ -75,6 +75,8 @@ Version 0.4.0 (under dev!)
aspell.check.suggestions (task #12061)
* aspell: fix creation of spellers when number of dictionaries is different
between two buffers
* guile: fix bad conversion of shared strings (replace calls to
scm_i_string_chars by scm_to_locale_string) (bug #38067)
* irc: fix display of actions (/me) when they are received from a relay client
(in channel and private buffers) (bug #38027)
* irc: fix memory leak when updating modes of channel

File diff suppressed because it is too large Load Diff

View File

@ -204,6 +204,7 @@ weechat_guile_alist_to_hashtable (SCM alist, int size, const char *type_keys,
struct t_hashtable *hashtable;
int length, i;
SCM pair;
char *str, *str2;
hashtable = weechat_hashtable_new (size,
type_keys,
@ -219,21 +220,25 @@ weechat_guile_alist_to_hashtable (SCM alist, int size, const char *type_keys,
pair = scm_list_ref (alist, scm_from_int (i));
if (strcmp (type_values, WEECHAT_HASHTABLE_STRING) == 0)
{
weechat_hashtable_set (hashtable,
scm_i_string_chars (scm_list_ref (pair,
scm_from_int (0))),
scm_i_string_chars (scm_list_ref (pair,
scm_from_int (1))));
str = scm_to_locale_string (scm_list_ref (pair, scm_from_int (0)));
str2 = scm_to_locale_string (scm_list_ref (pair, scm_from_int (1)));
weechat_hashtable_set (hashtable, str, str2);
if (str)
free (str);
if (str2)
free (str2);
}
else if (strcmp (type_values, WEECHAT_HASHTABLE_POINTER) == 0)
{
weechat_hashtable_set (hashtable,
scm_i_string_chars (scm_list_ref (pair,
scm_from_int (0))),
str = scm_to_locale_string (scm_list_ref (pair, scm_from_int (0)));
str2 = scm_to_locale_string (scm_list_ref (pair, scm_from_int (1)));
weechat_hashtable_set (hashtable, str,
plugin_script_str2ptr (weechat_guile_plugin,
NULL, NULL,
scm_i_string_chars (scm_list_ref (pair,
scm_from_int (1)))));
NULL, NULL, str2));
if (str)
free (str);
if (str2)
free (str2);
}
}