[xml] Fix how the output filename is built
Avoid problems when it contains the embedded strings ".c", ".cpp" or ".cxx". Fixes #540 reported by djack42.
This commit is contained in:
parent
2740812970
commit
a950d1309b
2 changed files with 10 additions and 3 deletions
|
|
@ -5,6 +5,11 @@ See the RELEASENOTES file for a summary of changes in each release.
|
||||||
Version 3.0.11 (in progress)
|
Version 3.0.11 (in progress)
|
||||||
============================
|
============================
|
||||||
|
|
||||||
|
2016-08-05: olly
|
||||||
|
[xml] Fix how the output filename is built to avoid problems when
|
||||||
|
it contains the embedded strings ".c", ".cpp" or ".cxx".
|
||||||
|
Fixes #540 reported by djack42.
|
||||||
|
|
||||||
2016-07-01: wsfulton
|
2016-07-01: wsfulton
|
||||||
Fix corner case of wrapping std::vector of T pointers where a pointer to a pointer of T
|
Fix corner case of wrapping std::vector of T pointers where a pointer to a pointer of T
|
||||||
also exists in the wrapped code. SF Bug 2359417 (967).
|
also exists in the wrapped code. SF Bug 2359417 (967).
|
||||||
|
|
|
||||||
|
|
@ -81,9 +81,11 @@ public:
|
||||||
virtual int top(Node *n) {
|
virtual int top(Node *n) {
|
||||||
if (out == 0) {
|
if (out == 0) {
|
||||||
String *outfile = Getattr(n, "outfile");
|
String *outfile = Getattr(n, "outfile");
|
||||||
Replaceall(outfile, ".cxx", ".xml");
|
String *ext = Swig_file_extension(outfile);
|
||||||
Replaceall(outfile, ".cpp", ".xml");
|
// If there's an extension, ext will include the ".".
|
||||||
Replaceall(outfile, ".c", ".xml");
|
Delslice(outfile, Len(outfile) - Len(ext), DOH_END);
|
||||||
|
Delete(ext);
|
||||||
|
Append(outfile, ".xml");
|
||||||
out = NewFile(outfile, "w", SWIG_output_files());
|
out = NewFile(outfile, "w", SWIG_output_files());
|
||||||
if (!out) {
|
if (!out) {
|
||||||
FileErrorDisplay(outfile);
|
FileErrorDisplay(outfile);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue