Fix SharedMemoryIO#read for binary data on Ruby 1.9+

This commit is contained in:
Marc Siegel committed 2013-12-27 13:38:23 -05:00
1 parent dddf0be4ef
commit 41b6777638
2 files changed
+37

No files matched your search

+1
View File
@@ -198,6 +198,7 @@ module ProcessShared
def read(length = nil, buffer = nil)
length ||= (mem.size - pos)
buffer ||= ''
buffer.force_encoding('ASCII-8BIT') unless RUBY_VERSION.start_with?('1.8')
actual_length = [(mem.size - pos), length].min
actual_length.times do