Permalink
Browse files

resetting the intent string after saving to an IO stream

  • Loading branch information...
1 parent e9cf72c commit 384326a54cacf58ba7d26f25283c19290a060b73 @tenderlove tenderlove committed Jul 28, 2009
Showing with 4 additions and 0 deletions.
  1. +4 −0 ext/nokogiri/xml_node.c
View
@@ -687,6 +687,8 @@ static VALUE native_write_to(
xmlIndentTreeOutput = 1;
+ const char * before_indent = xmlTreeIndentString;
+
xmlTreeIndentString = StringValuePtr(indent_string);
xmlSaveCtxtPtr savectx = xmlSaveToIO(
@@ -699,6 +701,8 @@ static VALUE native_write_to(
xmlSaveTree(savectx, node);
xmlSaveClose(savectx);
+
+ xmlTreeIndentString = before_indent;
return io;
}

0 comments on commit 384326a

Please sign in to comment.