Apply patch #3239076 from Marie White fixing strings for R >= 2.7.0

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12565 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
William S Fulton 2011-03-29 20:14:59 +00:00
commit e2fcd71e0c
2 changed files with 6 additions and 3 deletions

View file

@ -5,6 +5,9 @@ See the RELEASENOTES file for a summary of changes in each release.
Version 2.0.3 (in progress) Version 2.0.3 (in progress)
=========================== ===========================
2011-03-29: wsfulton
[R] Apply patch #3239076 from Marie White fixing strings for R >= 2.7.0
2011-03-29: wsfulton 2011-03-29: wsfulton
[Tcl] Apply patch #3248280 from Christian Delbaere which adds better error messages when [Tcl] Apply patch #3248280 from Christian Delbaere which adds better error messages when
the incorrect number or type of arguments are passed to overloaded methods. the incorrect number or type of arguments are passed to overloaded methods.

View file

@ -170,12 +170,12 @@ SWIG_FromCharPtrAndSize(const char* carray, size_t size)
order to allow for use of CHARSXP caches. */ order to allow for use of CHARSXP caches. */
Rf_protect(t = Rf_allocVector(STRSXP, 1)); Rf_protect(t = Rf_allocVector(STRSXP, 1));
#if R_VERSION >= R_Version(2,7,0) %#if R_VERSION >= R_Version(2,7,0)
c = Rf_mkCharLen(carray, size); c = Rf_mkCharLen(carray, size);
#else %#else
c = Rf_allocVector(CHARSXP, size); c = Rf_allocVector(CHARSXP, size);
strncpy((char *)CHAR(c), carray, size); strncpy((char *)CHAR(c), carray, size);
#endif %#endif
SET_STRING_ELT(t, 0, c); SET_STRING_ELT(t, 0, c);
Rf_unprotect(1); Rf_unprotect(1);
return t; return t;