Skip to content

Commit

Permalink
Fix 2295. Regexp.union [] gives wrong result in ruby 1.8 mode
Browse files Browse the repository at this point in the history
  • Loading branch information
enebo committed Dec 10, 2014
1 parent b5ce6b9 commit 2f56d95
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions core/src/main/java/org/jruby/RubyRegexp.java
Expand Up @@ -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++) {
Expand Down

0 comments on commit 2f56d95

Please sign in to comment.