Skip to content

Instantly share code, notes, and snippets.

@enebo
Created October 28, 2009 17:14
Show Gist options
  • Save enebo/220624 to your computer and use it in GitHub Desktop.
Save enebo/220624 to your computer and use it in GitHub Desktop.
diff --git a/src/org/jruby/RubyDir.java b/src/org/jruby/RubyDir.java
index a8d9508..19d5089 100644
--- a/src/org/jruby/RubyDir.java
+++ b/src/org/jruby/RubyDir.java
@@ -392,11 +392,10 @@ public class RubyDir extends RubyObject {
@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]);
+ RubyString stringArg = args[0].convertToString();
+ runtime.checkSafeString(stringArg);
- String path = args[0].convertToString().getUnicodeValue();
-
- return mkdirCommon(runtime, path, args);
+ return mkdirCommon(runtime, stringArg.getUnicodeValue(), args);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment