74f8d948bc
- backport r12814 from trunk (#753321) - use scm_to_utf8_string instead of SCM_STRING_CHARS in guile bindings (#752054) - improve Octave compatibility (#679948) Signed-off-by: Adam Tkac <atkac@redhat.com>
24 lines
845 B
Diff
24 lines
845 B
Diff
diff -up swig-2.0.4/Lib/guile/guile_scm_run.swg.rh752054 swig-2.0.4/Lib/guile/guile_scm_run.swg
|
|
--- swig-2.0.4/Lib/guile/guile_scm_run.swg.rh752054 2011-11-14 14:44:35.688597584 +0100
|
|
+++ swig-2.0.4/Lib/guile/guile_scm_run.swg 2011-11-14 14:45:15.879594778 +0100
|
|
@@ -64,7 +64,7 @@ static swig_module_info *SWIG_Guile_GetM
|
|
SWIGINTERN char *
|
|
SWIG_Guile_scm2newstr(SCM str, size_t *len) {
|
|
#define FUNC_NAME "SWIG_Guile_scm2newstr"
|
|
- char *ret;
|
|
+ char *ret, *tmp;
|
|
size_t l;
|
|
|
|
SCM_ASSERT (SCM_STRINGP(str), str, 1, FUNC_NAME);
|
|
@@ -73,7 +73,9 @@ SWIG_Guile_scm2newstr(SCM str, size_t *l
|
|
ret = (char *) SWIG_malloc( (l + 1) * sizeof(char));
|
|
if (!ret) return NULL;
|
|
|
|
- memcpy(ret, SCM_STRING_CHARS(str), l);
|
|
+ tmp = scm_to_utf8_string(str);
|
|
+ memcpy(ret, tmp, l);
|
|
+ free(tmp);
|
|
ret[l] = '\0';
|
|
if (len) *len = l;
|
|
return ret;
|