Revision
3173
Author
lsansonetti@apple.com
Date
2009-12-24 18:13:12 -0800 (Thu, 24 Dec 2009)

Log Message

#require: make sure the given argument is handled as a path, not a string

Modified Paths

Diff

Modified: MacRuby/trunk/load.c (3172 => 3173)


--- MacRuby/trunk/load.c	2009-12-24 23:18:43 UTC (rev 3172)
+++ MacRuby/trunk/load.c	2009-12-25 02:13:12 UTC (rev 3173)
@@ -261,19 +261,18 @@
 VALUE
 rb_require_safe(VALUE fname, int safe)
 {
-    StringValue(fname);
+    FilePathValue(fname);
 
-    VALUE result = Qnil;
-    VALUE path;
-    int type = 0;
-
     // Immediately, check out if we have an AOT feature for this.
     if (rb_vm_aot_feature_load(RSTRING_PTR(fname))) {
 	rb_provide_feature(fname);
 	return Qtrue;
     }
 
-    FilePathValue(fname);
+    VALUE result = Qnil;
+    VALUE path;
+    int type = 0;
+
     if (search_required(fname, &path, &type)) {
 	if (path == 0) {
 	    result = Qfalse;