Skip to content

Commit c505abd

Browse files
committed
Merge remote-tracking branch 'origin/jruby-9.4' into jruby-10.0
2 parents 8ec5d57 + 3615d58 commit c505abd

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

core/src/main/java/org/jruby/RubyIO.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4709,13 +4709,15 @@ public static IRubyObject popen(ThreadContext context, IRubyObject recv, IRubyOb
47094709

47104710
int firstArg = 0;
47114711

4712-
if (argc > 0 && !TypeConverter.checkHashType(runtime, args[0]).isNil()) {
4713-
firstArg++;
4712+
// process trailing keyword arguments hash
4713+
if (argc > 0 && !(tmp = TypeConverter.checkHashType(runtime, args[argc - 1])).isNil()) {
4714+
options = (RubyHash)tmp;
47144715
argc--;
47154716
}
47164717

4717-
if (argc > 0 && !(tmp = TypeConverter.checkHashType(runtime, args[argc - 1])).isNil()) {
4718-
options = (RubyHash)tmp;
4718+
// process leading env hash
4719+
if (argc > 0 && !TypeConverter.checkHashType(runtime, args[0]).isNil()) {
4720+
firstArg++;
47194721
argc--;
47204722
}
47214723

0 commit comments

Comments
 (0)