Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: jruby/jruby
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: aa2ea839564b
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: f8de9a00c2ce
Choose a head ref
  • 2 commits
  • 2 files changed
  • 2 contributors

Commits on Feb 1, 2018

  1. Fix String#rpartition for RegEx on Strings with multibyte chars

    because before it used the wrong index when there was a mulitbyte character in the string.
    We now let handle rindex function the index detection.
    ChrisBr committed Feb 1, 2018
    Copy the full SHA
    2c7b8f2 View commit details
  2. Merge pull request #5026 from ChrisBr/bug/fix-string-rpartition

    Fix String#rpartition for RegEx on Strings with multibyte chars
    enebo authored Feb 1, 2018
    Copy the full SHA
    f8de9a0 View commit details
Showing with 4 additions and 7 deletions.
  1. +4 −6 core/src/main/java/org/jruby/RubyString.java
  2. +0 −1 test/mri/excludes/TestString.rb
10 changes: 4 additions & 6 deletions core/src/main/java/org/jruby/RubyString.java
Original file line number Diff line number Diff line change
@@ -1509,7 +1509,7 @@ public RubyString reverse_bang19(ThreadContext context) {
}
value.setUnsafeBytes(obytes);
}

setCodeRange(cr);
}
return this;
@@ -4277,11 +4277,9 @@ public IRubyObject rpartition(ThreadContext context, IRubyObject arg) {
final int pos;
final RubyString sep;
if (arg instanceof RubyRegexp) {
RubyRegexp regex = (RubyRegexp)arg;

pos = regex.search(context, this, value.getRealSize(), true);

if (pos < 0) return rpartitionMismatch(runtime);
IRubyObject tmp = rindex(context, arg);
if (tmp.isNil()) return rpartitionMismatch(runtime);
pos = (int)tmp.convertToInteger().getIntValue();
sep = (RubyString)RubyRegexp.nth_match(0, context.getBackRef());
} else {
IRubyObject tmp = arg.checkStringType();
1 change: 0 additions & 1 deletion test/mri/excludes/TestString.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
exclude :test_casecmp?, "missing 2.4 case-folding logic (#4731)"
exclude :test_crypt, "does not raise as expected"
exclude :test_rpartition, "needs investigation"
exclude :test_setter, "does not raise as expected"