Last active
August 29, 2015 14:19
Revisions
-
alanivey revised this gist
Apr 21, 2015 . 1 changed file with 17 additions and 17 deletions.There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -3,20 +3,20 @@ index ed058d2..7c48017 100644 --- a/vendor/gems/libxml-ruby-1.1.3/ext/libxml/ruby_xml_node.c +++ b/vendor/gems/libxml-ruby-1.1.3/ext/libxml/ruby_xml_node.c @@ -571,10 +571,17 @@ static VALUE rxml_node_to_s(int argc, VALUE *argv, VALUE self) xmlNodeDumpOutput(output, xnode->doc, xnode, level, indent, xencoding); xmlOutputBufferFlush(output); +#ifdef LIBXML2_NEW_BUFFER + if (output->conv) + result = rxml_new_cstr((const char*) xmlBufContent(output->conv), xencoding); + else + result = rxml_new_cstr((const char*) xmlBufContent(output->buffer), xencoding); +#else if (output->conv) result = rb_str_new2((const char*) output->conv->content); else result = rb_str_new2((const char*) output->buffer->content); +#endif xmlOutputBufferClose(output); -
alanivey revised this gist
Apr 21, 2015 . 1 changed file with 3 additions and 2 deletions.There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -5,7 +5,7 @@ index ed058d2..7c48017 100644 @@ -571,10 +571,17 @@ static VALUE rxml_node_to_s(int argc, VALUE *argv, VALUE self) xmlNodeDumpOutput(output, xnode->doc, xnode, level, indent, xencoding); xmlOutputBufferFlush(output); +#ifdef LIBXML2_NEW_BUFFER + if (output->conv) + result = rxml_new_cstr((const char*) xmlBufContent(output->conv), xencoding); @@ -17,5 +17,6 @@ index ed058d2..7c48017 100644 else result = rb_str_new2((const char*) output->buffer->content); +#endif xmlOutputBufferClose(output); -
alanivey renamed this gist
Apr 21, 2015 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
alanivey revised this gist
Apr 21, 2015 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -18,4 +18,4 @@ index ed058d2..7c48017 100644 result = rb_str_new2((const char*) output->buffer->content); +#endif xmlOutputBufferClose(output); -
alanivey revised this gist
Apr 21, 2015 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -18,4 +18,4 @@ index ed058d2..7c48017 100644 result = rb_str_new2((const char*) output->buffer->content); +#endif xmlOutputBufferClose(output); -
alanivey created this gist
Apr 21, 2015 .There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,21 @@ diff --git a/vendor/gems/libxml-ruby-1.1.3/ext/libxml/ruby_xml_node.c b/vendor/gems/libxml-ruby-1.1.3/ext/libxml/ruby_xml_node.c index ed058d2..7c48017 100644 --- a/vendor/gems/libxml-ruby-1.1.3/ext/libxml/ruby_xml_node.c +++ b/vendor/gems/libxml-ruby-1.1.3/ext/libxml/ruby_xml_node.c @@ -571,10 +571,17 @@ static VALUE rxml_node_to_s(int argc, VALUE *argv, VALUE self) xmlNodeDumpOutput(output, xnode->doc, xnode, level, indent, xencoding); xmlOutputBufferFlush(output); +#ifdef LIBXML2_NEW_BUFFER + if (output->conv) + result = rxml_new_cstr((const char*) xmlBufContent(output->conv), xencoding); + else + result = rxml_new_cstr((const char*) xmlBufContent(output->buffer), xencoding); +#else if (output->conv) result = rb_str_new2((const char*) output->conv->content); else result = rb_str_new2((const char*) output->buffer->content); +#endif xmlOutputBufferClose(output);