Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: jruby/jruby
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 8d967deb0eec
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 1e30600bdbbf
Choose a head ref
  • 2 commits
  • 4 files changed
  • 1 contributor

Commits on Feb 9, 2016

  1. Copy the full SHA
    9de574b View commit details
  2. Copy the full SHA
    1e30600 View commit details
4 changes: 2 additions & 2 deletions core/src/main/java/org/jruby/Main.java
Original file line number Diff line number Diff line change
@@ -258,10 +258,10 @@ public Status run() {
private Status internalRun() {
doShowVersion();
doShowCopyright();
doPrintProperties();

if (!config.getShouldRunInterpreter() ) {
if (!config.getShouldRunInterpreter()) {
doPrintUsage(false);
doPrintProperties();
return new Status();
}

3 changes: 2 additions & 1 deletion core/src/main/java/org/jruby/RubyKernel.java
Original file line number Diff line number Diff line change
@@ -1520,8 +1520,9 @@ public static IRubyObject system(ThreadContext context, IRubyObject recv, IRubyO
@JRubyMethod(name = "system", required = 1, rest = true, module = true, visibility = PRIVATE)
public static IRubyObject system19(ThreadContext context, IRubyObject recv, IRubyObject[] args) {
Ruby runtime = context.runtime;
boolean needChdir = !runtime.getCurrentDirectory().equals(runtime.getPosix().getcwd());

if (runtime.getPosix().isNative() && !Platform.IS_WINDOWS) {
if (!needChdir && runtime.getPosix().isNative() && !Platform.IS_WINDOWS) {
// MRI: rb_f_system
long pid;
int[] status = new int[1];
1 change: 1 addition & 0 deletions spec/regression/GH-3653_check_no_expansion.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
exit(1) unless ARGV[0] == "$GH3653"
21 changes: 21 additions & 0 deletions spec/regression/GH-3653_system_under_chdir_expands_env.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
require 'tmpdir'

describe "Kernel#system when called during a Dir.chdir" do
it "does not expand environment variables" do
def sh(*cmd)
res = system(*cmd)
status = $?
p [res, status]
end

ENV['GH3653'] = 'someval'


Dir.chdir(Dir.tmpdir) do
sh ENV_JAVA['jruby.home'] + '/bin/jruby', File.dirname(__FILE__) + '/GH-3653_check_no_expansion.rb', '$GH3653'
end

expect($?.exitstatus).to eq(0)
end
end