Escape backslashes in docstrings.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@9840 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Olly Betts 2007-05-27 23:57:34 +00:00
commit af2d15d2a5
2 changed files with 6 additions and 0 deletions

View file

@ -1419,6 +1419,7 @@ public:
} else if (Getattr(n, "feature:callback")) {
if (have_docstring(n)) {
String *ds = docstring(n, AUTODOC_FUNC, "", false);
Replaceall(ds, "\\", "\\\\");
Replaceall(ds, "\n", "\\n");
Replaceall(ds, "\"", "\\\"");
Printf(methods, "(char *)\"%s\\nswig_ptr: %s\"", ds, Getattr(n, "feature:callback:name"));
@ -1427,6 +1428,7 @@ public:
}
} else if (have_docstring(n)) {
String *ds = docstring(n, AUTODOC_FUNC, "", false);
Replaceall(ds, "\\", "\\\\");
Replaceall(ds, "\n", "\\n");
Replaceall(ds, "\"", "\\\"");
Printf(methods, "(char *)\"%s\"", ds);