Skip to content

Commit

Permalink
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core/src/main/java/org/jruby/RubyRegexp.java
Original file line number Diff line number Diff line change
@@ -924,8 +924,8 @@ public IRubyObject initialize_m(IRubyObject arg0, IRubyObject arg1, IRubyObject

if (!arg2.isNil()) {
ByteList kcodeBytes = arg2.convertToString().getByteList();
if ((kcodeBytes.getRealSize() > 0 && kcodeBytes.getUnsafeBytes()[kcodeBytes.getBegin()] == 'n') ||
(kcodeBytes.getRealSize() > 1 && kcodeBytes.getUnsafeBytes()[kcodeBytes.getBegin() + 1] == 'N')) {
if (kcodeBytes.getRealSize() > 0 && (kcodeBytes.get(0) == 'n' || kcodeBytes.get(0) == 'N')) {
newOptions.setEncodingNone(true);
return regexpInitialize(arg0.convertToString().getByteList(), ASCIIEncoding.INSTANCE, newOptions);
} else {
getRuntime().getWarnings().warn("encoding option is ignored - " + kcodeBytes);

0 comments on commit c95e294

Please sign in to comment.