Skip to content

Commit

Permalink
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions core/src/main/java/org/jruby/RubyIO.java
Original file line number Diff line number Diff line change
@@ -3136,7 +3136,7 @@ private IRubyObject readNotAll(ThreadContext context, OpenFile myOpenFile, int l
Ruby runtime = context.runtime;
str.empty();

if (length == 0) return str;
if (runtime.is1_9() && length == 0) return str;

try {
ByteList newBuffer = readNotAllCommon(context, myOpenFile, length);
@@ -3163,7 +3163,7 @@ private IRubyObject readNotAll(ThreadContext context, OpenFile myOpenFile, int l
private IRubyObject readNotAll(ThreadContext context, OpenFile myOpenFile, int length) {
Ruby runtime = context.runtime;

if (length == 0) return RubyString.newEmptyString(runtime);
if (runtime.is1_9() && length == 0) return RubyString.newEmptyString(runtime);

try {
ByteList newBuffer = readNotAllCommon(context, myOpenFile, length);
2 changes: 1 addition & 1 deletion test/test_socket.rb
Original file line number Diff line number Diff line change
@@ -530,6 +530,6 @@ def test_read_zero_never_blocks
ensure
server.close rescue nil
client.close rescue nil
end
end if RUBY_VERSION >= '1.9'
end

0 comments on commit 5c47af7

Please sign in to comment.