diff --git a/ChangeLog b/ChangeLog index 5c7b4cd822..5e20705215 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Tue Jun 12 21:40:13 2012 Tanaka Akira + + * process.c (rb_exec_fillarg): treat '=' character as an meta + character to detect assignments preceding command name. + Tue Jun 12 20:29:19 2012 Tanaka Akira * include/ruby/intern.h (rb_exec_arg_init): deprecated. diff --git a/process.c b/process.c index 6af0fe0ccf..fabf12caea 100644 --- a/process.c +++ b/process.c @@ -1880,7 +1880,7 @@ rb_exec_fillarg(VALUE prog, int argc, VALUE *argv, VALUE env, VALUE opthash, str for (p = RSTRING_PTR(prog); *p; p++) { if (!has_nonspace && *p != ' ' && *p != '\t') has_nonspace = 1; - if (!has_meta && strchr("*?{}[]<>()~&|\\$;'`\"\n#", *p)) + if (!has_meta && strchr("*?{}[]<>()~&|\\$;'`\"\n#=", *p)) has_meta = 1; if (has_nonspace && has_meta) break; diff --git a/test/ruby/test_process.rb b/test/ruby/test_process.rb index b3ecc420ed..943ffc77d7 100644 --- a/test/ruby/test_process.rb +++ b/test/ruby/test_process.rb @@ -1433,4 +1433,11 @@ class TestProcess < Test::Unit::TestCase } end + def test_sh_env + IO.popen("foofoo=barbar env") {|f| + lines = f.readlines + assert_operator(lines, :include?, "foofoo=barbar\n") + } + end if File.executable?("/bin/sh") + end