Permalink
Browse files

Fix for File#read eof

  • Loading branch information...
1 parent 78c4723 commit e8bab8839222d7a1f547e55beb204910e74d3f90 @rifraf committed May 2, 2010
@@ -12,14 +12,7 @@
doc = Document.new(string)
doc.write $stdout
-#??????????? Next line bust at the moment...
-#doc = Document.new File.new("mydoc.xml")
-#???????????
-s = SerfSupp.read_embedded_file("mydoc.xml")
-doc = Document.new(s)
-#doc.write $stdout
-#???????????
-
+doc = Document.new File.new("mydoc.xml")
doc.elements.each("inventory/section") { |element| puts element.attributes["name"] }
p __LINE__
# -> health
@@ -138,6 +138,7 @@ def select_binarymode
end
def read(num)
+ return nil if eof?
if @textmode
str = ""
last_ch = nil
Binary file not shown.
Binary file not shown.
View
Binary file not shown.
Binary file not shown.

0 comments on commit e8bab88

Please sign in to comment.