Skip to content

Commit

Permalink
JRUBY-4179: [1.8] Dir.mkdir should accept any arg that responds to #to_s
Browse files Browse the repository at this point in the history
  • Loading branch information
enebo committed Oct 28, 2009
1 parent 373a914 commit d663b8e
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/org/jruby/RubyDir.java
Expand Up @@ -382,11 +382,10 @@ public static RubyString getwd(IRubyObject recv) {
@JRubyMethod(name = "mkdir", required = 1, optional = 1, meta = true, compat = CompatVersion.RUBY1_8)
public static IRubyObject mkdir(IRubyObject recv, IRubyObject[] args) {
Ruby runtime = recv.getRuntime();
runtime.checkSafeString(args[0]);

String path= args[0].convertToString().getUnicodeValue();
RubyString stringArg = args[0].convertToString();
runtime.checkSafeString(stringArg);

return mkdirCommon(runtime, path, args);
return mkdirCommon(runtime, stringArg.getUnicodeValue(), args);
}

@JRubyMethod(name = "mkdir", required = 1, optional = 1, meta = true, compat = CompatVersion.RUBY1_9)
Expand Down

0 comments on commit d663b8e

Please sign in to comment.