Skip to content

Commit

Permalink
Repair backref logic for String#[].
Browse files Browse the repository at this point in the history
  • Loading branch information
headius committed Mar 24, 2015
1 parent 6f1d6e7 commit dd733e4
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions core/src/main/java/org/jruby/RubyString.java
Expand Up @@ -3000,12 +3000,10 @@ private IRubyObject subpat19(Ruby runtime, ThreadContext context, RubyRegexp reg
}

private IRubyObject subpat19(Ruby runtime, ThreadContext context, RubyRegexp regex) {
IRubyObject[] holder = {context.nil};

int result = regex.search19(context, this, 0, false);

if (result >= 0) {
return RubyRegexp.nth_match(0, holder[0]);
return RubyRegexp.nth_match(0, context.getBackRef());
}

return runtime.getNil();
Expand Down

0 comments on commit dd733e4

Please sign in to comment.