Skip to content

Commit

Permalink
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions core/src/main/java/org/jruby/RubyIO.java
Original file line number Diff line number Diff line change
@@ -1755,14 +1755,13 @@ public RubyFixnum sysseek(ThreadContext context, IRubyObject[] args) {

private static int interpretSeekWhence(IRubyObject vwhence) {
if (vwhence instanceof RubySymbol) {
if (vwhence.toString() == "SET")
return PosixShim.SEEK_SET;
if (vwhence.toString() == "CUR")
return PosixShim.SEEK_CUR;
if (vwhence.toString() == "END")
return PosixShim.SEEK_END;
}
return (int)vwhence.convertToInteger().getLongValue();
String string = vwhence.toString();

if ("SET".equals(string)) return PosixShim.SEEK_SET;
if ("CUR".equals(string)) return PosixShim.SEEK_CUR;
if ("END".equals(string)) return PosixShim.SEEK_END;
}
return (int) vwhence.convertToInteger().getLongValue();
}

// rb_io_rewind

0 comments on commit c9790ea

Please sign in to comment.