fix empty std::string case, reported by Daniel Moore
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@9076 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
dfdd4c8060
commit
09d0d6b4ff
1 changed files with 5 additions and 1 deletions
|
|
@ -40,7 +40,11 @@ SWIG_AsPtr_dec(String)(SWIG_Object obj, String **val)
|
||||||
SWIGINTERNINLINE SWIG_Object
|
SWIGINTERNINLINE SWIG_Object
|
||||||
SWIG_From_dec(String)(const String& s)
|
SWIG_From_dec(String)(const String& s)
|
||||||
{
|
{
|
||||||
return SWIG_FromCharPtrAndSize(s.data(), s.size());
|
if (s.size()) {
|
||||||
|
return SWIG_FromCharPtrAndSize(s.data(), s.size());
|
||||||
|
} else {
|
||||||
|
return SWIG_FromCharPtrAndSize("", 1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
%enddef
|
%enddef
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue