Skip to content

Instantly share code, notes, and snippets.

@alanivey
Last active August 29, 2015 14:19

Revisions

  1. alanivey revised this gist Apr 21, 2015. 1 changed file with 17 additions and 17 deletions.
    34 changes: 17 additions & 17 deletions libxml-ruby-1.1.3-libxml2-2.9.patch
    Original 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);

    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);

  2. alanivey revised this gist Apr 21, 2015. 1 changed file with 3 additions and 2 deletions.
    5 changes: 3 additions & 2 deletions libxml-ruby-1.1.3-libxml2-2.9.patch
    Original 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);

  3. alanivey renamed this gist Apr 21, 2015. 1 changed file with 0 additions and 0 deletions.
  4. alanivey revised this gist Apr 21, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion libxml-ruby-1.1.3-libxml2-2.9
    Original 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);
    xmlOutputBufferClose(output);
  5. alanivey revised this gist Apr 21, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion libxml-ruby-1.1.3-libxml2-2.9
    Original 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);
    xmlOutputBufferClose(output);
  6. alanivey created this gist Apr 21, 2015.
    21 changes: 21 additions & 0 deletions libxml-ruby-1.1.3-libxml2-2.9
    Original 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);