diff --git a/load.c b/load.c index cf3adcbb3e..d6616fc5cd 100644 --- a/load.c +++ b/load.c @@ -991,7 +991,7 @@ rb_resolve_feature_path(VALUE klass, VALUE fname) sym = ID2SYM(rb_intern("so")); break; default: - load_failed(fname); + return Qnil; } return rb_ary_new_from_args(2, sym, path); diff --git a/test/ruby/test_require.rb b/test/ruby/test_require.rb index 30c07b9e5c..973d9c92f1 100644 --- a/test/ruby/test_require.rb +++ b/test/ruby/test_require.rb @@ -857,5 +857,9 @@ class TestRequire < Test::Unit::TestCase $:.replace(paths) $".replace(loaded) end + + def test_resolve_feature_path_with_missing_feature + assert_nil($LOAD_PATH.resolve_feature_path("superkalifragilisticoespialidoso")) + end end end