[macruby-changes] [4235] MacRuby/trunk/lib/net/protocol.rb
source_changes at macosforge.org
source_changes at macosforge.org
Thu Jun 17 15:01:22 PDT 2010
Revision: 4235
http://trac.macosforge.org/projects/ruby/changeset/4235
Author: martinlagardette at apple.com
Date: 2010-06-17 15:01:18 -0700 (Thu, 17 Jun 2010)
Log Message:
-----------
Make sure we only call force_encoding if it's available...
Modified Paths:
--------------
MacRuby/trunk/lib/net/protocol.rb
Modified: MacRuby/trunk/lib/net/protocol.rb
===================================================================
--- MacRuby/trunk/lib/net/protocol.rb 2010-06-17 20:12:57 UTC (rev 4234)
+++ MacRuby/trunk/lib/net/protocol.rb 2010-06-17 22:01:18 UTC (rev 4235)
@@ -79,7 +79,7 @@
def read(len, dest = '', ignore_eof = false)
LOG "reading #{len} bytes..."
read_bytes = 0
- dest.force_encoding("BINARY")
+ dest.force_encoding("BINARY") if dest.respond_to?(:force_encoding)
begin
while read_bytes + @rbuf.bytesize < len
dest << (s = rbuf_consume(@rbuf.bytesize))
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20100617/b0f26ab5/attachment.html>
More information about the macruby-changes
mailing list