diff options
author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-06-12 12:41:08 +0000 |
---|---|---|
committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-06-12 12:41:08 +0000 |
commit | 640e0a33b7a198be030b4080e32404a319f4c468 (patch) | |
tree | 7880b8097b0cffcd16f6b7a2673af96d7d1591ed | |
parent | 0dcc1f0dfe1e02e882f5f42c0c8a20cf371737e2 (diff) | |
download | ruby-640e0a33b7a198be030b4080e32404a319f4c468.tar.gz |
* process.c (rb_exec_fillarg): treat '=' character as an meta
character to detect assignments preceding command name.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36041 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | process.c | 2 | ||||
-rw-r--r-- | test/ruby/test_process.rb | 7 |
3 files changed, 13 insertions, 1 deletions
@@ -1,3 +1,8 @@ +Tue Jun 12 21:40:13 2012 Tanaka Akira <akr@fsij.org> + + * 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 <akr@fsij.org> * include/ruby/intern.h (rb_exec_arg_init): deprecated. @@ -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 |