Skip to content
Permalink
Browse files
Fix 2295. Regexp.union [] gives wrong result in ruby 1.8 mode
  • Loading branch information
enebo committed Dec 10, 2014
1 parent b5ce6b9 commit 2f56d95a854736d8843dde2f96ff17b50c011900
Showing with 1 addition and 0 deletions.
  1. +1 −0 core/src/main/java/org/jruby/RubyRegexp.java
@@ -1139,6 +1139,7 @@ public static IRubyObject union(ThreadContext context, IRubyObject recv, IRubyOb
if (a.isNil()) return newRegexp(runtime, quote(context, recv, args).getByteList());

RubyArray aa = (RubyArray)a;
if (aa.size() == 0) return newRegexp(runtime, ByteList.create("(?!)"));
int len = aa.getLength();
realArgs = new IRubyObject[len];
for(int i = 0; i<len; i++) {

0 comments on commit 2f56d95

Please sign in to comment.