Skip to content

Commit 1ce8c7d

Browse files
committed
JRUBY-4709: Add trailing sep to classpath to make sure PWD is included (like jruby.sh)
1 parent 4e449d3 commit 1ce8c7d

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

argparser.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -477,6 +477,11 @@ void ArgParser::constructClassPath() {
477477
classPath += cpAfter;
478478
}
479479

480+
// JRUBY-4709: Include this by default to have PWD as part of classpath
481+
if (!classPath.empty()) {
482+
classPath += PATH_SEP;
483+
}
484+
480485
logMsg("ClassPath: %s", classPath.c_str());
481486
}
482487

spec/launcher_spec.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,10 +148,16 @@
148148
jruby_launcher("-Xjdkhome '' 2>&1").should =~ /-Xjdkhome/
149149
end
150150

151+
# JRUBY-4706
151152
it "should put JRuby on regular classpath when -Xnobootclasspath is used" do
152153
args = jruby_launcher_args("-e true")
153154
args.grep(/Xbootclasspath/).should_not be_empty
154155
args = jruby_launcher_args("-Xnobootclasspath -e true")
155156
args.grep(/Xbootclasspath/).should be_empty
156157
end
158+
159+
# JRUBY-4709
160+
it "should include a bare : at the end of the classpath, to include PWD in the path" do
161+
jruby_launcher_args("-Xnobootclasspath -e true").grep(/java\.class\.path/).first.should =~ /:$/
162+
end
157163
end

0 commit comments

Comments
 (0)