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

@ -1,6 +1,10 @@
Version 1.3.32 (in progress) Version 1.3.32 (in progress)
============================ ============================
05/28/2007: olly
[Python]
Escape backslashes in docstrings.
05/26/2007: olly 05/26/2007: olly
[Python] [Python]
Fix autodoc generation of enums to be more consistent with how the Fix autodoc generation of enums to be more consistent with how the

View file

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