Skip to content

Commit ea53fd6

Browse files
committed
[Truffle] Expand a path in $LOAD_PATH if it is relative.
1 parent 034c7cd commit ea53fd6

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

truffle/src/main/java/org/jruby/truffle/runtime/subsystems/FeatureManager.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,10 @@ public boolean require(String feature, Node currentNode) throws IOException {
7070
// Try each load path in turn
7171

7272
for (Object pathObject : context.getCoreLibrary().getLoadPath().slowToArray()) {
73-
final String loadPath = pathObject.toString();
73+
String loadPath = pathObject.toString();
74+
if (!isAbsolutePath(loadPath)) {
75+
loadPath = RubyFile.expandPath(context, loadPath);
76+
}
7477

7578
if (requireInPath(loadPath, feature, currentNode)) {
7679
return true;

0 commit comments

Comments
 (0)